From 050683b5283889008164526b980cb1658c4f66b7 Mon Sep 17 00:00:00 2001 From: Michael Liendo Date: Sat, 13 Jul 2024 21:16:48 -0400 Subject: [PATCH] feat: set the routes and the base structure for the auth --- client/src/App.tsx | 4 +++- client/src/Routes.tsx | 35 +++++++++++++++++++++++++++++++++++ client/src/main.tsx | 5 ++++- client/src/pages/home.tsx | 7 +++++++ 4 files changed, 49 insertions(+), 2 deletions(-) create mode 100644 client/src/Routes.tsx create mode 100644 client/src/pages/home.tsx diff --git a/client/src/App.tsx b/client/src/App.tsx index d3ca128..a68a291 100644 --- a/client/src/App.tsx +++ b/client/src/App.tsx @@ -1,7 +1,9 @@ +import { Routes } from './Routes'; + function App() { return ( <> -

Tailwind ON

+ ); } diff --git a/client/src/Routes.tsx b/client/src/Routes.tsx new file mode 100644 index 0000000..4a9a99d --- /dev/null +++ b/client/src/Routes.tsx @@ -0,0 +1,35 @@ +import Home from './pages/home'; +import { Routes as ReactRoutes, Route } from 'react-router'; + +export enum PublicRoutesEnum { + Home = '/', +} + +export enum AuthRoutesEnum { + Login = '/login', + SignUp = '/signup', + Welcome = '/welcome', +} + +export enum PrivateRoutesEnum {} + +export function Routes() { + return ( + + {/* {user ? PrivateRoutes.map((route) => route) : AuthRoutes.map((route) => route)} */} + {PublicRoutes.map((route) => route)} + + ); +} + +const _PrivateRoutes: JSX.Element[] = []; + +const _AuthRoutes: JSX.Element[] = []; + +const PublicRoutes = [ + , +]; diff --git a/client/src/main.tsx b/client/src/main.tsx index 2e19d07..57d3094 100644 --- a/client/src/main.tsx +++ b/client/src/main.tsx @@ -2,10 +2,13 @@ import React from 'react'; import ReactDOM from 'react-dom/client'; import App from './App.tsx'; import './main.css'; +import { BrowserRouter } from 'react-router-dom'; // biome-ignore lint/style/noNonNullAssertion: ReactDOM.createRoot(document.getElementById('root')!).render( - + + + , ); diff --git a/client/src/pages/home.tsx b/client/src/pages/home.tsx new file mode 100644 index 0000000..4a56aed --- /dev/null +++ b/client/src/pages/home.tsx @@ -0,0 +1,7 @@ +export default function Home() { + return ( + <> +

Home

+ + ); +}