|
|
|
import React from "react";
|
|
|
|
import { BrowserRouter, Routes, Route } from "react-router-dom";
|
|
|
|
import { connect } from "react-redux";
|
|
|
|
import Navbar from "./components/Navbar";
|
|
|
|
import BG from "./components/BG";
|
|
|
|
|
|
|
|
import _ from "lodash";
|
|
|
|
import Home from "./views/Home";
|
|
|
|
import Products from "./views/Products";
|
|
|
|
// import VideoTube from "./views/Home/VideoTube";
|
|
|
|
|
|
|
|
function Router({ isDark }) {
|
|
|
|
return (
|
|
|
|
<div className={_.join([isDark ? "dark" : ""], " ")}>
|
|
|
|
<div
|
|
|
|
className={_.join(
|
|
|
|
[
|
|
|
|
"min-h-screen min-w-screen rtl overflow-x-hidden pt-20 lg:pt-0",
|
|
|
|
isDark ? "" : "bg-white",
|
|
|
|
],
|
|
|
|
" "
|
|
|
|
)}
|
|
|
|
>
|
|
|
|
<BrowserRouter>
|
|
|
|
<Navbar />
|
|
|
|
<BG />
|
|
|
|
<Routes>
|
|
|
|
<Route path="/" exact element={<Home />} />
|
|
|
|
<Route path="/products" exact element={<Products />} />
|
|
|
|
<Route
|
|
|
|
path="*"
|
|
|
|
element={
|
|
|
|
<main>
|
|
|
|
<h1>No matches routes.</h1>
|
|
|
|
</main>
|
|
|
|
}
|
|
|
|
/>
|
|
|
|
</Routes>
|
|
|
|
</BrowserRouter>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
);
|
|
|
|
}
|
|
|
|
|
|
|
|
const mapStateToProps = (state) => ({
|
|
|
|
isDark: state.publicApi.isDark,
|
|
|
|
});
|
|
|
|
|
|
|
|
export default connect(mapStateToProps, {})(Router);
|