Mobile view and misc.

This commit is contained in:
Sean Edmunds
2024-09-09 14:52:45 -05:00
parent e9ccd0906c
commit 94757369a5
7 changed files with 45 additions and 25 deletions

View File

@@ -21,15 +21,18 @@ export default function Homepage({ theme }: any) {
key: 'bookmarkFilter',
defaultValue: ['All'],
});
const isMobile = window.matchMedia('(max-width: 600px)').matches;
function date() {
const currentDate = new Date();
const dateOptions: Intl.DateTimeFormatOptions = {
weekday: 'long',
year: 'numeric',
month: 'long',
day: 'numeric',
};
const date = currentDate.toLocaleDateString('en-GB', dateOptions);
const dateOptions: Intl.DateTimeFormatOptions = !isMobile
? {
weekday: 'long',
year: 'numeric',
month: 'long',
day: 'numeric',
}
: {};
const date = currentDate.toLocaleDateString('en-US', dateOptions);
return date;
}
function greet(list: any) {
@@ -60,9 +63,9 @@ export default function Homepage({ theme }: any) {
return (
<Stack gap={0} className={stackClasses.containerStack} justify='center'>
<Search />
<Header date={date()} greet={displayedGreeting} />
<Applications contentType={appFilter} />
<Bookmarks contentType={bookmarkFilter} />
<Header date={date()} greet={displayedGreeting} isMobile={isMobile} />
<Applications contentType={appFilter} isMobile={isMobile} />
<Bookmarks contentType={bookmarkFilter} isMobile={isMobile} />
<SettingsButton
theme={theme}
setAppFilter={setAppFilter}