(force) Update project: Added 60 new features and made various changes
{warning: this all chnaged}
This commit is contained in:
30
src/App.tsx
30
src/App.tsx
@@ -17,8 +17,17 @@ import Profile from "./pages/profile";
|
||||
import { Toaster } from "react-hot-toast";
|
||||
import { IsAuthenticated } from "./utils/auth";
|
||||
import { HelmetProvider } from "react-helmet-async";
|
||||
import InActivePayment from "./pages/inActivePayment";
|
||||
import { useSelector } from "react-redux";
|
||||
import { RootState } from "./redux/store";
|
||||
import Page404 from "./pages/404";
|
||||
// import LandingLayout from "./layout/LandingLayout";
|
||||
// import Landing from "./pages/landing";
|
||||
|
||||
const App = () => {
|
||||
const { isPaymentGateway } = useSelector(
|
||||
(state: RootState) => state.isPaymentGatewayState
|
||||
);
|
||||
return (
|
||||
<Router basename="/">
|
||||
<HelmetProvider>
|
||||
@@ -29,9 +38,13 @@ const App = () => {
|
||||
/>
|
||||
<ProgressBar />
|
||||
<Routes>
|
||||
{/* <Route path="/" element={<LandingLayout />}>
|
||||
<Route index element={<Landing />}></Route>
|
||||
<Route path="/configs/:configs" element={<Navigate to='/shopping-config' />} />
|
||||
</Route> */}
|
||||
<Route path="/" element={<Layout />}>
|
||||
<Route index element={<Shop />} />
|
||||
<Route path="configs/:configs" element={<Navigate to="/" />} />
|
||||
<Route path="/configs/:configs" element={<Navigate to='/' />} />
|
||||
<Route path="tutorial" element={<Tutorial />} />
|
||||
<Route path="rule" element={<Rule />} />
|
||||
<Route path="about" element={<About />} />
|
||||
@@ -40,10 +53,10 @@ const App = () => {
|
||||
</Route>
|
||||
</Route>
|
||||
<Route
|
||||
path="login"
|
||||
path="/login"
|
||||
element={
|
||||
IsAuthenticated() ? (
|
||||
<Navigate to="/" replace={true} />
|
||||
<Navigate to="/profile" replace={true} />
|
||||
) : (
|
||||
<AuthLayout />
|
||||
)
|
||||
@@ -51,6 +64,17 @@ const App = () => {
|
||||
>
|
||||
<Route index element={<Login />} />
|
||||
</Route>
|
||||
<Route
|
||||
path="/noactive-payment"
|
||||
element={
|
||||
isPaymentGateway ? (
|
||||
<Navigate to="/" />
|
||||
) : (
|
||||
<InActivePayment />
|
||||
)
|
||||
}
|
||||
/>
|
||||
<Route path="*" element={<Page404 />} />
|
||||
</Routes>
|
||||
</HelmetProvider>
|
||||
</Router>
|
||||
|
||||
Reference in New Issue
Block a user