-
-
Notifications
You must be signed in to change notification settings - Fork 83
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(deps): upgrade to mantine v7 (#283)
Co-authored-by: Aether Chen <15167799+chenjunyu19@users.noreply.github.com> feat: add auto scroll to tables feat: wp cards feat: unify team info query hook feat: update challenge accepted count fix: use config hook fix: challenge countdown not work fix: last fallback to `sans-serif` for `monospace` fix: footer padding fix: strange rendering behavior of `Segmented Control` in the user edit modal.
- Loading branch information
1 parent
eabffc7
commit a72e47d
Showing
120 changed files
with
2,929 additions
and
2,296 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
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
Large diffs are not rendered by default.
Oops, something went wrong.
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,5 @@ | ||
export default { | ||
plugins: { | ||
'postcss-preset-mantine': {}, | ||
}, | ||
}; |
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 |
---|---|---|
|
@@ -13,6 +13,7 @@ export default { | |
'^@Components/(.*)$', | ||
'^@Utils/(.*)$', | ||
'^@Api$', | ||
'^@(.*).css$', | ||
'^[./]', | ||
], | ||
} |
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,29 @@ | ||
body { | ||
padding: 0; | ||
margin: 0; | ||
|
||
background-color: light-dark(var(--mantine-color-gray-2), var(--mantine-color-gray-7)); | ||
color: light-dark(var(--mantine-color-gray-7), var(--mantine-color-dark-0)); | ||
|
||
@media print { | ||
background-color: light-dark(var(--mantine-color-white), var(--mantine-color-gray-7)); | ||
} | ||
} | ||
|
||
::-webkit-scrollbar { | ||
height: 6px; | ||
width: 6px; | ||
} | ||
|
||
::-webkit-scrollbar-thumb { | ||
background: var(--mantine-color-dark-3); | ||
border-radius: 3px; | ||
} | ||
|
||
::-webkit-scrollbar-track { | ||
background-color: transparent; | ||
} | ||
|
||
::-webkit-scrollbar-corner { | ||
background-color: transparent; | ||
} |
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 |
---|---|---|
@@ -1,102 +1,63 @@ | ||
import { | ||
Center, | ||
ColorScheme, | ||
ColorSchemeProvider, | ||
Global, | ||
Loader, | ||
MantineProvider, | ||
} from '@mantine/core' | ||
import { useLocalStorage } from '@mantine/hooks' | ||
import { Center, Loader, MantineProvider } from '@mantine/core' | ||
import { DatesProvider } from '@mantine/dates' | ||
import { emotionTransform, MantineEmotionProvider } from '@mantine/emotion' | ||
import { ModalsProvider } from '@mantine/modals' | ||
import { Notifications } from '@mantine/notifications' | ||
import { FC, Suspense } from 'react' | ||
import { useTranslation } from 'react-i18next' | ||
import { useRoutes } from 'react-router-dom' | ||
import { SWRConfig } from 'swr' | ||
import routes from '~react-pages' | ||
import { ThemeOverride } from '@Utils/ThemeOverride' | ||
import { useLanguage } from '@Utils/I18n' | ||
import { CustomTheme } from '@Utils/ThemeOverride' | ||
import { useBanner, localCacheProvider } from '@Utils/useConfig' | ||
import { fetcher } from '@Api' | ||
import '@mantine/carousel/styles.css' | ||
import '@mantine/core/styles.css' | ||
import '@mantine/dates/styles.css' | ||
import '@mantine/dropzone/styles.css' | ||
import '@mantine/notifications/styles.css' | ||
import './App.css' | ||
|
||
export const App: FC = () => { | ||
const [colorScheme, setColorScheme] = useLocalStorage<ColorScheme>({ | ||
key: 'color-scheme', | ||
defaultValue: 'dark', | ||
getInitialValueInEffect: true, | ||
}) | ||
|
||
const toggleColorScheme = (value?: ColorScheme) => | ||
setColorScheme(value || (colorScheme === 'dark' ? 'light' : 'dark')) | ||
|
||
useBanner() | ||
|
||
const { t } = useTranslation() | ||
const { locale } = useLanguage() | ||
|
||
return ( | ||
<ColorSchemeProvider colorScheme={colorScheme} toggleColorScheme={toggleColorScheme}> | ||
<MantineProvider withGlobalStyles withCSSVariables theme={{ ...ThemeOverride, colorScheme }}> | ||
<MantineProvider | ||
defaultColorScheme="dark" | ||
theme={CustomTheme} | ||
stylesTransform={emotionTransform} | ||
> | ||
<MantineEmotionProvider> | ||
<Notifications zIndex={5000} /> | ||
{StyledGlobal} | ||
<ModalsProvider | ||
labels={{ confirm: t('common.modal.confirm'), cancel: t('common.modal.cancel') }} | ||
> | ||
<SWRConfig | ||
value={{ | ||
refreshInterval: 10000, | ||
provider: localCacheProvider, | ||
fetcher, | ||
}} | ||
|
||
<DatesProvider settings={{ locale }}> | ||
<ModalsProvider | ||
labels={{ confirm: t('common.modal.confirm'), cancel: t('common.modal.cancel') }} | ||
> | ||
<Suspense | ||
fallback={ | ||
<Center h="100vh" w="100vw"> | ||
<Loader /> | ||
</Center> | ||
} | ||
<SWRConfig | ||
value={{ | ||
refreshInterval: 10000, | ||
provider: localCacheProvider, | ||
fetcher, | ||
}} | ||
> | ||
{useRoutes(routes)} | ||
</Suspense> | ||
</SWRConfig> | ||
</ModalsProvider> | ||
</MantineProvider> | ||
</ColorSchemeProvider> | ||
<Suspense | ||
fallback={ | ||
<Center h="100vh" w="100vw"> | ||
<Loader /> | ||
</Center> | ||
} | ||
> | ||
{useRoutes(routes)} | ||
</Suspense> | ||
</SWRConfig> | ||
</ModalsProvider> | ||
</DatesProvider> | ||
</MantineEmotionProvider> | ||
</MantineProvider> | ||
) | ||
} | ||
|
||
const StyledGlobal = ( | ||
<Global | ||
styles={(theme) => ({ | ||
body: { | ||
...theme.fn.fontStyles(), | ||
backgroundColor: | ||
theme.colorScheme === 'dark' ? theme.colors.gray[7] : theme.colors.white[2], | ||
color: theme.colorScheme === 'dark' ? theme.colors.dark[0] : theme.colors.gray[7], | ||
lineHeight: theme.lineHeight, | ||
padding: 0, | ||
margin: 0, | ||
|
||
'@media print': { | ||
backgroundColor: theme.colorScheme === 'dark' ? theme.colors.gray[7] : theme.white, | ||
}, | ||
}, | ||
|
||
'::-webkit-scrollbar': { | ||
height: 6, | ||
width: 6, | ||
}, | ||
|
||
'::-webkit-scrollbar-thumb': { | ||
background: 'var(--mantine-color-dark-3)', | ||
borderRadius: 3, | ||
}, | ||
|
||
'::-webkit-scrollbar-track': { | ||
backgroundColor: 'transparent', | ||
}, | ||
|
||
'::-webkit-scrollbar-corner': { | ||
backgroundColor: 'transparent', | ||
}, | ||
})} | ||
/> | ||
) |
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
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.