Themes modal udpated

This commit is contained in:
Sean Edmunds
2024-08-15 17:07:48 -05:00
parent a47f201fff
commit a37ab84f65
45 changed files with 1480 additions and 1177 deletions

View File

@@ -1,28 +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 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";
export default function Homepage({theme}:any) {
const { data, isFetching } = useQueryAPI({ endpoint: 'api/messages' });
const [displayedGreeting, setDisplayedGreeting] = useState('');
const [contentType, setContentType] = useLocalStorage<any>({ key: 'contenttype', defaultValue: 'All' });
export default function Homepage({ theme }: any) {
const { data, isFetching } = useQueryAPI({ endpoint: "api/messages" });
const [displayedGreeting, setDisplayedGreeting] = useState("");
const [contentType, setContentType] = useLocalStorage<any>({
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) {
@@ -32,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);
@@ -51,12 +54,16 @@ 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}/>
<Bookmarks contentType={contentType}/>
<SettingsButton theme={theme} contentType={contentType} setContentType={setContentType}/>
<Applications contentType={contentType} />
<Bookmarks contentType={contentType} />
<SettingsButton
theme={theme}
contentType={contentType}
setContentType={setContentType}
/>
</Stack>
);
}