Skip to content
Merged
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
20 changes: 10 additions & 10 deletions index.html
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
<!doctype html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<link rel="icon" type="image/svg+xml" href="/vite.svg" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Vite + React + TS</title>
</head>
<body>
<div id="root"></div>
<script type="module" src="/src/main.tsx"></script>
</body>
<head>
<meta charset="UTF-8" />
<link rel="icon" type="image/svg+xml" href="/vite.svg" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Vite + React + TS</title>
</head>
<body class="bg-gray-50">
<div id="root"></div>
<script type="module" src="/src/main.tsx"></script>
</body>
</html>
167 changes: 150 additions & 17 deletions src/App.css
Original file line number Diff line number Diff line change
@@ -1,10 +1,142 @@
@import "tailwindcss";

body {
margin: 0;
font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, 'Noto Sans', sans-serif, 'Apple Color Emoji', 'Segoe UI Emoji', 'Segoe UI Symbol', 'Noto Color Emoji';
background-color: #f8f9fa;
}

html, body {
height: 100%;
width: 100%;
}

#root {
max-width: 1280px;
margin: 0 auto;
padding: 2rem;
text-align: center;
display: flex;
flex-direction: column;
min-height: 100vh;
}

.flex {
display: flex;
}

.flex-col {
flex-direction: column;
}

.min-h-screen {
min-height: 100vh;
}

.w-full {
width: 100%;
}

.bg-gray-100 {
background-color: #f7fafc;
}

.flex-1 {
flex: 1;
}

.max-w-7xl {
max-width: 80rem;
}

.mx-auto {
margin-left: auto;
margin-right: auto;
}

.px-4 {
padding-left: 1rem;
padding-right: 1rem;
}

.sm\:px-6 {
padding-left: 1.5rem;
padding-right: 1.5rem;
}

.lg\:px-8 {
padding-left: 2rem;
padding-right: 2rem;
}

.py-8 {
padding-top: 2rem;
padding-bottom: 2rem;
}

.bg-white {
background-color: #ffffff;
}

.rounded-lg {
border-radius: 0.5rem;
}

.shadow-md {
box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.text-gray-600 {
color: #718096;
}

.text-gray-900 {
color: #1a202c;
}

.text-3xl {
font-size: 1.875rem;
line-height: 2.25rem;
}

.font-semibold {
font-weight: 600;
}

.mb-4 {
margin-bottom: 1rem;
}

.mb-6 {
margin-bottom: 1.5rem;
}

.space-x-4 > :not([hidden]) ~ :not([hidden]) {
--tw-space-x-reverse: 0;
margin-right: calc(1rem * var(--tw-space-x-reverse));
margin-left: calc(1rem * calc(1 - var(--tw-space-x-reverse)));
}

.bg-blue-600 {
background-color: #3182ce;
}

.text-white {
color: #ffffff;
}

.font-bold {
font-weight: 700;
}

.py-2 {
padding-top: 0.5rem;
padding-bottom: 0.5rem;
}

.px-4 {
padding-left: 1rem;
padding-right: 1rem;
}

.rounded {
border-radius: 0.25rem;
}

.logo {
Expand Down Expand Up @@ -43,18 +175,16 @@
color: #888;
}

.chats {
text-align: left;
width: 15%;
height: 200%;
float: left;
background-color: #888;
position: fixed;
.hover\:bg-blue-700:hover {
background-color: #2b6cb0;
}

.chat-messages {
text-align: left;
margin-left: 15%;
.transition {
transition: all 0.2s;
}

.bg-gray-300 {
background-color: #e2e8f0;
}

.chats-form {
Expand All @@ -65,9 +195,12 @@
text-align: center;
}

.text-input {
width: 67vw;
margin-right: 1vw;
.text-gray-700 {
color: #4a5568;
}

.hover\:bg-gray-400:hover {
background-color: #cbd5e0;
}

.chats-submit {
Expand Down
90 changes: 41 additions & 49 deletions src/App.tsx
Original file line number Diff line number Diff line change
@@ -1,54 +1,46 @@
import Home from "./pages/Home";
import Contact from "./pages/Contact";
import SignIn from "./pages/SignIn";
import SignUp from "./pages/SignUp";
import Dashboard from "./pages/Dashboard";
import Search from "./pages/Search";
import Chats from "./pages/Chats";
import TutorPage from "./pages/TutorPage";
import Header from "./components/Header";
import Footer from "./components/Footer";
import "./App.css";
import { store } from "./services/auth";
import { BrowserRouter, Routes, Route } from "react-router-dom";
import ProtectedRoutes from "./utils/protectedRoutes";
import AuthProvider from "react-auth-kit";
import Home from './pages/Home';
import Contact from './pages/Contact';
import SignIn from './pages/SignIn';
import SignUp from './pages/SignUp';
import Dashboard from './pages/Dashboard';
import Search from './pages/Search';
import Chats from './pages/Chats';
import TutorPage from './pages/TutorPage';
import Header from './components/Header';
import Footer from './components/Footer';
import './App.css';
import { store } from './services/auth';
import { BrowserRouter, Routes, Route } from 'react-router-dom';
import ProtectedRoutes from './utils/protectedRoutes';
import AuthProvider from 'react-auth-kit';

function App() {
return (
<AuthProvider store={store}>
<BrowserRouter>
<div className="flex flex-col min-h-screen w-full bg-gray-100">
<Header />
<main className="flex-1 w-full max-w-7xl mx-auto px-4 sm:px-6 lg:px-8 py-8">
<Routes>
<Route path="/" element={<Home />} />
<Route path="/signin" element={<SignIn />} />
<Route path="/signup" element={<SignUp />} />
<Route path="/contact" element={<Contact />} />
<Route element={<ProtectedRoutes />}>
<Route
path="/dashboard"
element={<Dashboard />}
/>
<Route path="/search" element={<Search />} />
<Route
path="/search/tutor/:tutorID"
element={<TutorPage />}
/>
<Route path="/chat" element={<Chats />} />
<Route
path="/chat/:chatID"
element={<Chats />}
/>
</Route>
</Routes>
</main>
<Footer />
</div>
</BrowserRouter>
</AuthProvider>
);
return (
<AuthProvider store={store}>
<BrowserRouter>
<div className="flex flex-col min-h-screen w-full bg-gray-100">
<Header />
<main className="flex-1 w-full max-w-7xl mx-auto px-4 sm:px-6 lg:px-8 py-8">
<Routes>
<Route path="/" element={<Home />} />
<Route path="/signin" element={<SignIn />} />
<Route path="/signup" element={<SignUp />} />
<Route path="/contact" element={<Contact />} />
<Route element={<ProtectedRoutes />}>
<Route path="/dashboard" element={<Dashboard />} />
<Route path="/search" element={<Search />} />
<Route path="/search/tutor/:tutorID" element={<TutorPage />} />
<Route path="/chat" element={<Chats />} />
<Route path="/chat/:chatID" element={<Chats />} />

</Route>
</Routes>
</main>
<Footer />
</div>
</BrowserRouter>
</AuthProvider>
);
}

export default App;
29 changes: 16 additions & 13 deletions src/components/SettingsButton.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,20 +5,23 @@ export default function SettingsButton() {
const [isPopupOpen, setIsPopupOpen] = useState(false);
return (
<div>
<button onClick={() => setIsPopupOpen(true)}>Settings</button>
<button
onClick={() => setIsPopupOpen(true)}
className="bg-blue-600 text-white font-bold py-2 px-4 rounded hover:bg-blue-700 transition"
>
Settings
</button>
{isPopupOpen && (
<div
style={{
position: "fixed",
top: "50%",
left: "50%",
transform: "translate(-50%, -50%)",
background: "white",
zIndex: 1000,
}}
>
<button onClick={() => setIsPopupOpen(false)}>✖</button>
<SettingsDashboard />
<div className="fixed inset-0 flex items-center justify-center bg-black bg-opacity-50 z-50">
<div className="bg-white p-8 rounded-lg shadow-lg max-w-md w-full">
<button
onClick={() => setIsPopupOpen(false)}
className="text-gray-500 hover:text-gray-700 transition absolute top-4 right-4"
>
</button>
<SettingsDashboard />
</div>
</div>
)}
</div>
Expand Down
Loading
Loading