Skip to content

Commit

Permalink
update vercel
Browse files Browse the repository at this point in the history
  • Loading branch information
ZavNatalia committed Dec 23, 2024
1 parent 1246da8 commit c823c5c
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 14 deletions.
16 changes: 7 additions & 9 deletions src/app/App.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import React, { memo, Suspense, useEffect } from 'react';
import React, { memo, useEffect } from 'react';
import { useSelector } from 'react-redux';
import { classNames } from '@/shared/lib/classNames/classNames';
import { useTheme } from '@/shared/lib/hooks/useTheme/useTheme';
Expand Down Expand Up @@ -28,14 +28,12 @@ const App = memo(() => {

return (
<div id="app" className={classNames('app', {}, [theme])}>
<Suspense fallback="">
<MainLayout
header={<Navbar />}
content={<AppRouter />}
sidebar={<Sidebar />}
toolbar={toolbar}
/>
</Suspense>
<MainLayout
header={<Navbar />}
content={<AppRouter />}
sidebar={<Sidebar />}
toolbar={toolbar}
/>
</div>
);
});
Expand Down
5 changes: 1 addition & 4 deletions src/app/providers/router/ui/AppRouter.tsx
Original file line number Diff line number Diff line change
@@ -1,15 +1,12 @@
import React, { memo, Suspense, useCallback } from 'react';
import { Route, Routes } from 'react-router-dom';
import { PageLoader } from '@/widgets/PageLoader';
import { RequireAuth } from '../ui/RequireAuth';
import { routeConfig } from '../config/routeConfig';
import { AppRoutesProps } from '@/shared/types/router';

const AppRouter = () => {
const renderWithWrapper = useCallback((route: AppRoutesProps) => {
const element = (
<Suspense fallback={<PageLoader />}>{route.element}</Suspense>
);
const element = <Suspense fallback="">{route.element}</Suspense>;

return (
<Route
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,4 +21,4 @@
.active {
background-color: var(--color-bg-default);
color: var(--color-text-inverted);
}
}
3 changes: 3 additions & 0 deletions vercel.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,5 +14,8 @@
"src": "/(.*)",
"dest": "build/index.html"
}
],
"rewrites": [
{ "source": "/(.*)", "destination": "/" }
]
}

0 comments on commit c823c5c

Please sign in to comment.