-
-
Notifications
You must be signed in to change notification settings - Fork 39
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Frontend overhaul: Technical baseline for mantine (#1486)
* refactor: Move old css and js code * refactor: Add AppShell scaffolding * fix: Fix ArrayExtensions * fix: Remove "new_beta" from stylesheet options * chores: Remove unused code * chores: Remove unused imports
- Loading branch information
Showing
95 changed files
with
2,928 additions
and
310 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,89 @@ | ||
import { | ||
AppShell, | ||
Navbar, | ||
Header, | ||
UnstyledButton, | ||
Group, | ||
ThemeIcon, | ||
Text, | ||
MantineColor, | ||
} from '@mantine/core'; | ||
import { IconMusic } from '@tabler/icons-react'; | ||
|
||
const linkData = [ | ||
{ icon: <IconMusic size="1rem" />, color: 'blue', label: 'Songs' }, | ||
]; | ||
|
||
interface MainLinkProps { | ||
icon: React.ReactNode; | ||
color: MantineColor; | ||
label: string; | ||
} | ||
|
||
const MainLink = ({ | ||
icon, | ||
color, | ||
label, | ||
}: MainLinkProps): React.ReactElement => { | ||
return ( | ||
<UnstyledButton | ||
// eslint-disable-next-line @typescript-eslint/explicit-function-return-type | ||
sx={(theme) => ({ | ||
display: 'block', | ||
width: '100%', | ||
padding: theme.spacing.xs, | ||
borderRadius: theme.radius.sm, | ||
color: | ||
theme.colorScheme === 'dark' ? theme.colors.dark[0] : theme.black, | ||
|
||
'&:hover': { | ||
backgroundColor: | ||
theme.colorScheme === 'dark' | ||
? theme.colors.dark[6] | ||
: theme.colors.gray[0], | ||
}, | ||
})} | ||
> | ||
<Group> | ||
<ThemeIcon color={color} variant="light"> | ||
{icon} | ||
</ThemeIcon> | ||
|
||
<Text size="sm">{label}</Text> | ||
</Group> | ||
</UnstyledButton> | ||
); | ||
}; | ||
|
||
const NewApp = (): React.ReactElement => { | ||
return ( | ||
<AppShell | ||
navbarOffsetBreakpoint="sm" | ||
navbar={ | ||
<Navbar p="md" hiddenBreakpoint="sm" width={{ sm: 200, lg: 300 }}> | ||
{linkData.map((link) => ( | ||
<MainLink {...link} key={link.label} /> | ||
))} | ||
</Navbar> | ||
} | ||
header={ | ||
<Header height={{ base: 50, md: 70 }} p="md"> | ||
{/* Header content */} | ||
</Header> | ||
} | ||
// eslint-disable-next-line @typescript-eslint/explicit-function-return-type | ||
styles={(theme) => ({ | ||
main: { | ||
backgroundColor: | ||
theme.colorScheme === 'dark' | ||
? theme.colors.dark[8] | ||
: theme.colors.gray[0], | ||
}, | ||
})} | ||
> | ||
{/* Your application here */} | ||
</AppShell> | ||
); | ||
}; | ||
|
||
export default NewApp; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,77 @@ | ||
import AppRoutes from '@/AppRoutes'; | ||
import Container from '@/Bootstrap/Container'; | ||
import { AboutDisclaimer } from '@/Components/Shared/Partials/AboutDisclaimer'; | ||
import { Header } from '@/Components/Shared/Partials/Header'; | ||
import { LeftMenu } from '@/Components/Shared/Partials/LeftMenu'; | ||
import { miniPlayerHeight, VdbPlayer } from '@/Components/VdbPlayer/VdbPlayer'; | ||
import { useVdb } from '@/VdbContext'; | ||
import '@/i18n'; | ||
import '@/styles/Icons.css'; | ||
import '@/styles/css.less'; | ||
import '@/styles/jquery.qtip.css'; | ||
import '@/styles/themes/redmond/jquery-ui-1.10.1.custom.min.css'; | ||
import { ScrollToTop } from '@vocadb/route-sphere'; | ||
import React from 'react'; | ||
import { Toaster } from 'react-hot-toast'; | ||
|
||
const UtaiteDB = React.lazy(() => import('./styles/utaiteDb')); | ||
const TetoDB = React.lazy(() => import('./styles/tetoDb')); | ||
const DarkAngel = React.lazy(() => import('./styles/darkAngel')); | ||
|
||
const AppContainer = (): React.ReactElement => { | ||
const vdb = useVdb(); | ||
|
||
return ( | ||
<Container | ||
fluid | ||
css={{ | ||
flex: '1 1 100%', | ||
paddingBottom: miniPlayerHeight, | ||
minWidth: 0, | ||
overflow: 'hidden', | ||
}} | ||
> | ||
<div className="row-fluid"> | ||
<div className="span12 rightFrame well"> | ||
<React.Suspense fallback={null /* TODO */}> | ||
<AppRoutes /> | ||
</React.Suspense> | ||
</div> | ||
<AboutDisclaimer /> | ||
</div> | ||
<React.Suspense fallback={null}> | ||
{vdb.values.loggedUser?.stylesheet && ( | ||
<> | ||
{vdb.values.loggedUser?.stylesheet | ||
.toLowerCase() | ||
.startsWith('darkangel') && <DarkAngel />} | ||
|
||
{vdb.values.loggedUser?.stylesheet | ||
.toLowerCase() | ||
.startsWith('tetodb') && <TetoDB />} | ||
{vdb.values.siteName.toLowerCase().includes('utaite') && ( | ||
<UtaiteDB /> | ||
)} | ||
</> | ||
)} | ||
</React.Suspense> | ||
</Container> | ||
); | ||
}; | ||
|
||
const OldApp = (): React.ReactElement => { | ||
return ( | ||
<> | ||
<ScrollToTop /> | ||
<Header /> | ||
<div css={{ display: 'flex' }}> | ||
<LeftMenu /> | ||
<AppContainer /> | ||
</div> | ||
<Toaster containerStyle={{ top: '10vh' }} gutter={0} /> | ||
<VdbPlayer />{' '} | ||
</> | ||
); | ||
}; | ||
|
||
export default OldApp; |
File renamed without changes.
File renamed without changes.
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes.
File renamed without changes.
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.