You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

37 lines
992 B

7 months ago
7 months ago
7 months ago
7 months ago
7 months ago
7 months ago
7 months ago
7 months ago
  1. import { AppContextProvider } from '@/context.ts'
  2. import { initI18n } from '@/i18n.ts'
  3. import { appAtom, appStore, changeLanguage } from '@/store/system.ts'
  4. import { IAppData } from '@/global'
  5. import { ConfigProvider } from '@/components/config-provider'
  6. import { Provider, useAtom } from 'jotai'
  7. import './App.css'
  8. import { useEffect } from 'react'
  9. import { RootProvider } from './routes.tsx'
  10. function App() {
  11. const [ appData, ] = useAtom(appAtom)
  12. useEffect(() => {
  13. initI18n()
  14. }, [])
  15. return (
  16. <ConfigProvider>
  17. <AppContextProvider value={{
  18. get appData() {
  19. return appData as IAppData
  20. },
  21. changeLanguage
  22. }}>
  23. <Provider store={appStore}>
  24. <RootProvider context={{}}/>
  25. </Provider>
  26. </AppContextProvider>
  27. </ConfigProvider>
  28. )
  29. }
  30. export default App