From 76a20d76855ab8661e04dae1a53305d3da4efcc1 Mon Sep 17 00:00:00 2001 From: strNophix Date: Tue, 4 Oct 2022 18:01:10 +0200 Subject: [PATCH] Moved routes from App.tsx and stores from index.tsx --- client/src/App.tsx | 21 ++++++--------------- client/src/main.tsx | 6 +----- client/src/routes/index.tsx | 24 ++++++++++++++++++++++++ 3 files changed, 31 insertions(+), 20 deletions(-) create mode 100644 client/src/routes/index.tsx diff --git a/client/src/App.tsx b/client/src/App.tsx index 2cd819b..fd3c755 100644 --- a/client/src/App.tsx +++ b/client/src/App.tsx @@ -1,22 +1,13 @@ -import { Routes, Route } from 'react-router-dom'; +import { BrowserRouter } from 'react-router-dom'; -import BrowseLayout from './components/BrowseLayout'; -import CategoryPage from './pages/CategoryPage'; -import ChannelPage from './pages/ChannelPage'; -import LoginPage from './pages/LoginPage'; -import SignupPage from './pages/SignupPage'; +import Routes from './routes'; +import './styles/global.css'; function App() { return ( - - } /> - } /> - }> - } /> - } /> - Hi} /> - - + + + ); } diff --git a/client/src/main.tsx b/client/src/main.tsx index 0ff7988..f770324 100644 --- a/client/src/main.tsx +++ b/client/src/main.tsx @@ -1,14 +1,10 @@ import React from 'react'; import ReactDOM from 'react-dom/client'; -import { BrowserRouter } from 'react-router-dom'; import App from './App'; -import './styles/global.css'; ReactDOM.createRoot(document.getElementById('root') as HTMLElement).render( - - - + ); diff --git a/client/src/routes/index.tsx b/client/src/routes/index.tsx new file mode 100644 index 0000000..2c2b620 --- /dev/null +++ b/client/src/routes/index.tsx @@ -0,0 +1,24 @@ +import { FC } from 'react'; +import { Routes, Route } from 'react-router-dom'; + +import BrowseLayout from '../components/BrowseLayout'; +import CategoryPage from '../pages/CategoryPage'; +import ChannelPage from '../pages/ChannelPage'; +import LoginPage from '../pages/LoginPage'; +import SignupPage from '../pages/SignupPage'; + +const Router: FC = () => { + return ( + + } /> + } /> + }> + } /> + } /> + Hi} /> + + + ); +}; + +export default Router;