This commit is contained in:
Sean Edmunds
2024-08-20 16:28:46 -05:00
parent 8152d3fe73
commit 7990f164d6
39 changed files with 824 additions and 772 deletions

View File

@@ -1,31 +1,31 @@
import { Stack } from "@mantine/core";
import stackClasses from "../../styles/Stack.module.css";
import { useQueryAPI } from "../../hooks/useAPI";
import Search from "./components/Search";
import Header from "./components/Header";
import Applications from "./components/Applications";
import Bookmarks from "./components/Bookmarks";
import SettingsButton from "./components/SettingsButton";
import { useEffect, useState } from "react";
import "../../index.css";
import { useLocalStorage } from "@mantine/hooks";
import { Stack } from '@mantine/core';
import { useEffect, useState } from 'react';
import { useQueryAPI } from '../../hooks/useAPI';
import stackClasses from '../../styles/Stack.module.css';
import Applications from './components/Applications';
import Bookmarks from './components/Bookmarks';
import Header from './components/Header';
import Search from './components/Search';
import SettingsButton from './components/SettingsButton';
import '../../index.css';
import { useLocalStorage } from '@mantine/hooks';
export default function Homepage({ theme }: any) {
const { data, isFetching } = useQueryAPI({ endpoint: "api/messages" });
const [displayedGreeting, setDisplayedGreeting] = useState("");
const { data, isFetching } = useQueryAPI({ endpoint: 'api/messages' });
const [displayedGreeting, setDisplayedGreeting] = useState('');
const [contentType, setContentType] = useLocalStorage<any>({
key: "contenttype",
defaultValue: "All",
key: 'contenttype',
defaultValue: 'All',
});
function date() {
const currentDate = new Date();
const dateOptions: Intl.DateTimeFormatOptions = {
weekday: "long",
year: "numeric",
month: "long",
day: "numeric",
weekday: 'long',
year: 'numeric',
month: 'long',
day: 'numeric',
};
const date = currentDate.toLocaleDateString("en-GB", dateOptions);
const date = currentDate.toLocaleDateString('en-GB', dateOptions);
return date;
}
function greet(list: any) {
@@ -35,7 +35,7 @@ export default function Homepage({ theme }: any) {
let timeBased: any = [];
let easterEggs: any = [];
for (const l of list) {
if (l.easteregg === "N") {
if (l.easteregg === 'N') {
timeBased = timeBased.concat(l);
} else {
easterEggs = easterEggs.concat(l);
@@ -54,7 +54,7 @@ export default function Homepage({ theme }: any) {
}, [isFetching]);
return (
<Stack gap={0} className={stackClasses.containerStack} justify="center">
<Stack gap={0} className={stackClasses.containerStack} justify='center'>
<Search />
<Header date={date()} greet={displayedGreeting} />
<Applications contentType={contentType} />