-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #22 from XinFinOrg/demo
Merge demo code to master
- Loading branch information
Showing
87 changed files
with
2,940 additions
and
1,112 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,23 +1,40 @@ | ||
import { useState } from 'react'; | ||
import { Outlet } from 'react-router-dom'; | ||
import { Outlet, useNavigation } from 'react-router-dom'; | ||
|
||
import Alert from '@/components/alert/Alert'; | ||
import Loader from '@/components/loader/Loader'; | ||
import Nav from '@/components/nav/Nav'; | ||
import { ThemeModes } from '@/components/theme-switch/ThemeSwitch'; | ||
import { ThemeContext } from '@/contexts/themeContext'; | ||
import AlertProvider from '@/contexts/AlertContext'; | ||
import ThemeContextProvider from '@/contexts/ThemeContext'; | ||
import TimeContextProvider from '@/contexts/TimeContext'; | ||
import { useIsDesktop } from '@/hooks/useMediaQuery'; | ||
|
||
function App() { | ||
const [theme, setTheme] = useState<ThemeModes>('light'); | ||
const navigation = useNavigation(); | ||
const isDesktop = useIsDesktop(); | ||
|
||
return ( | ||
<ThemeContext.Provider value={{ theme, setTheme }}> | ||
<div className='relative max-w-[1440px] m-auto flex font-nunito-sans text-text-dark dark:text-text-white dark:bg-bg-dark-900'> | ||
<Nav /> | ||
<main className="mx-6 my-8 grow w-[1146px]"> | ||
<Outlet /> | ||
</main> | ||
</div> | ||
</ThemeContext.Provider> | ||
<TimeContextProvider> | ||
<ThemeContextProvider> | ||
<AlertProvider> | ||
<div className={`${!isDesktop ? 'flex-col' : ''} | ||
relative max-w-[1440px] mx-auto flex font-nunito-sans text-text-dark dark:text-text-white dark:bg-bg-dark-900` | ||
}> | ||
<Nav /> | ||
<main className='mx-6 my-8 grow llg-w-[1146px] relative'> | ||
{navigation.state === 'loading' ? ( | ||
<Loader /> | ||
) : ( | ||
<> | ||
<Outlet /> | ||
<Alert /> | ||
</> | ||
)} | ||
</main> | ||
</div> | ||
</AlertProvider> | ||
</ThemeContextProvider> | ||
</TimeContextProvider> | ||
); | ||
} | ||
|
||
export default App; | ||
export default App; |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file not shown.
Oops, something went wrong.