App.tsx 686 B

123456789101112131415161718192021222324252627282930
  1. import React from 'react';
  2. import PageLayout from './components/layout';
  3. import { ConfigProvider } from 'antd';
  4. import useConfigStore from './store/config';
  5. import { useNavigate } from 'react-router-dom';
  6. const App: React.FC = () => {
  7. const theme = useConfigStore(state => state.themeConfig)
  8. const navigate = useNavigate()
  9. // TODO: refactor this logic
  10. if (window.location.pathname === '/') {
  11. setTimeout(() => {
  12. navigate('/account/list')
  13. })
  14. }
  15. return (
  16. <ConfigProvider theme={{
  17. algorithm: theme.algorithm,
  18. token: {
  19. colorPrimary: theme.primaryColor
  20. }
  21. }}>
  22. <PageLayout />
  23. </ConfigProvider>
  24. )
  25. };
  26. export default App;