Videos Page Not Showing In Desktop Version (Redirects To Products)

temp
Pedram Keshavarzi 3 years ago
parent b445010ce2
commit 95032e76cd
  1. 11
      src/router.js

@ -1,5 +1,6 @@
import React, { useEffect } from "react"; import React, { useEffect } from "react";
import { BrowserRouter, Routes, Route } from "react-router-dom"; import { BrowserRouter, Routes, Route, } from "react-router-dom";
import { Navigate } from 'react-router-dom';
import { connect } from "react-redux"; import { connect } from "react-redux";
import { publicApi } from "./redux/actions"; import { publicApi } from "./redux/actions";
import Navbar from "./components/Navbar"; import Navbar from "./components/Navbar";
@ -155,9 +156,10 @@ function Router({
} }
/> />
<Route <Route
path="/videos" path='/videos'
exact exact
element={ element={
isMobile ?
<Videos <Videos
headerOptions={{ headerOptions={{
logo: true, logo: true,
@ -168,9 +170,10 @@ function Router({
shown: true, shown: true,
menu: false, menu: false,
}} }}
/> /> : <Navigate replace to="/products" />
} }
/> >
</Route>
<Route <Route
path="/videos/:id" path="/videos/:id"
exact exact

Loading…
Cancel
Save