Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Implemented Routes and Pages #5

Open
wants to merge 4 commits into
base: starter
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
41 changes: 40 additions & 1 deletion package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,8 @@
},
"dependencies": {
"react": "19.0.0-rc-8b08e99e-20240713",
"react-dom": "19.0.0-rc-8b08e99e-20240713"
"react-dom": "19.0.0-rc-8b08e99e-20240713",
"react-router-dom": "^6.26.0"
},
"devDependencies": {
"@types/react": "^18.3.3",
Expand Down
16 changes: 16 additions & 0 deletions src/index.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
*{
padding: 0;
margin: 0;
box-sizing: border-box;
}

body {
background-color: #0e0c16;
color: #ececec;
font-family: system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Open Sans', 'Helvetica Neue', sans-serif;
}

a{
text-decoration: none;
color: inherit;
}
15 changes: 15 additions & 0 deletions src/layouts/dashboardLayout/DashBoardLayout.jsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
import { Outlet } from 'react-router-dom';
import './dashboardLayout.css';

const DashBoardLayout = () => {
return (
<div className="dashboard-layout">
<div className="menu">MENU</div>
<div className="content">
<Outlet />
</div>
</div>
);
};

export default DashBoardLayout;
Empty file.
21 changes: 21 additions & 0 deletions src/layouts/rootLayout/RootLayOut.jsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
import { Link, Outlet } from "react-router-dom";
import "./rootLayout.css";


const RootLayOut = () => {
return (
<div className="rootLayout">
<header>
<Link>
<img src="/logo.png" alt="logo"/>
<span>IntellectBot</span>
</Link>
</header>
<main>
<Outlet />
</main>
</div>
);
};

export default RootLayOut;
Empty file.
44 changes: 37 additions & 7 deletions src/main.jsx
Original file line number Diff line number Diff line change
@@ -1,10 +1,40 @@
import React from 'react'
import ReactDOM from 'react-dom/client'
import App from './App.jsx'
import './index.css'
import React from 'react';
import ReactDOM from 'react-dom/client';
import './index.css';
import { createBrowserRouter, RouterProvider } from 'react-router-dom';
import HomePage from './routes/homePage/HomePage.jsx';
import DashBoard from './routes/dashboardPage/DashboardPage.jsx';
import ChatPage from './routes/chatPage/ChatPage.jsx';
import RootLayOut from './layouts/rootLayout/RootLayOut.jsx';
import DashBoardLayout from './layouts/dashboardLayout/DashBoardLayout.jsx';

const router = createBrowserRouter([
{
element: <RootLayOut />,
children: [
{
path: '/',
element: <HomePage />,
},
{
element: <DashBoardLayout />,
children: [
{
path: '/dashboard',
element: <DashBoard />,
},
{
path: '/dashboard/chats/:id',
element: <ChatPage />,
}
]
},
]
},
]);

ReactDOM.createRoot(document.getElementById('root')).render(
<React.StrictMode>
<App />
</React.StrictMode>,
)
<RouterProvider router={router} />
</React.StrictMode>
);
11 changes: 11 additions & 0 deletions src/routes/chatPage/ChatPage.jsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
import './chatPage.css';

const ChatPage = () => {
return (
<div className="chat-page">
<h1>Chat Page</h1>
</div>
);
};

export default ChatPage;
Empty file.
11 changes: 11 additions & 0 deletions src/routes/dashboardPage/DashboardPage.jsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
import "./dashboardPage.css";

const DashboardPage = () => {
return (
<div className="dashboard-page">
<h1>Dashboard Page</h1>
</div>
);
};

export default DashboardPage;
Empty file.
10 changes: 10 additions & 0 deletions src/routes/homePage/HomePage.jsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
import './homePage.css';

const HomePage = () => {
return (
<div className="homepage">
<h1>Homepage</h1>
</div>
);
};
export default HomePage;
Empty file.
11 changes: 11 additions & 0 deletions src/routes/signInPage/SignInPage.jsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
import './signInPage.css';

const SignInPage = () => {
return (
<div className="sign-in">
<h1>Sign In Page</h1>
</div>
);
};

export default SignInPage;
Empty file.
11 changes: 11 additions & 0 deletions src/routes/signUpPage/SignUpPage.jsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
import './signUpPage.css';

const SignUpPage = () => {
return (
<div className="sign-up-page">
<h1>Sign Up Page</h1>
</div>
);
};

export default SignUpPage;
Empty file.