Skip to content

Commit

Permalink
feat: set the routes and the base structure for the auth
Browse files Browse the repository at this point in the history
  • Loading branch information
Michael-Liendo committed Jul 14, 2024
1 parent bcefc53 commit 050683b
Show file tree
Hide file tree
Showing 4 changed files with 49 additions and 2 deletions.
4 changes: 3 additions & 1 deletion client/src/App.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
import { Routes } from './Routes';

function App() {
return (
<>
<h2 className="underline text-2xl bg-teal-300">Tailwind ON</h2>
<Routes />
</>
);
}
Expand Down
35 changes: 35 additions & 0 deletions client/src/Routes.tsx
Original file line number Diff line number Diff line change
@@ -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 (
<ReactRoutes>
{/* {user ? PrivateRoutes.map((route) => route) : AuthRoutes.map((route) => route)} */}
{PublicRoutes.map((route) => route)}
</ReactRoutes>
);
}

const _PrivateRoutes: JSX.Element[] = [];

const _AuthRoutes: JSX.Element[] = [];

const PublicRoutes = [
<Route
key={PublicRoutesEnum.Home}
path={PublicRoutesEnum.Home}
Component={Home}
/>,
];
5 changes: 4 additions & 1 deletion client/src/main.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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: <explanation>
ReactDOM.createRoot(document.getElementById('root')!).render(
<React.StrictMode>
<App />
<BrowserRouter>
<App />
</BrowserRouter>
</React.StrictMode>,
);
7 changes: 7 additions & 0 deletions client/src/pages/home.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
export default function Home() {
return (
<>
<h1 className="text-black text-4xl">Home</h1>
</>
);
}

0 comments on commit 050683b

Please sign in to comment.