Skip to content

Commit

Permalink
refactor: remove pages directory
Browse files Browse the repository at this point in the history
  • Loading branch information
Kevin Wu committed Aug 28, 2024
1 parent c236ff4 commit f327cb5
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 17 deletions.
12 changes: 6 additions & 6 deletions client/src/App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,12 @@ import { Flex } from "@chakra-ui/react";
import { Route, BrowserRouter as Router, Routes } from "react-router-dom";

import { CatchAll } from "./components/CatchAll";
import { Dashboard } from "./components/dashboard/Dashboard";
import { Login } from "./components/login/Login";
import { ProtectedRoute } from "./components/ProtectedRoute";
import { Signup } from "./components/signup/Signup";
import { AuthProvider } from "./contexts/AuthContext";
import { BackendProvider } from "./contexts/BackendContext";
import { DashboardPage } from "./pages/DashboardPage";
import { LoginPage } from "./pages/LoginPage";
import { SignupPage } from "./pages/SignupPage";

const App = () => {
return (
Expand All @@ -27,15 +27,15 @@ const App = () => {
<Routes>
<Route
path="/login"
element={<LoginPage />}
element={<Login />}
/>
<Route
path="/signup"
element={<SignupPage />}
element={<Signup />}
/>
<Route
path="/dashboard"
element={<ProtectedRoute element={<DashboardPage />} />}
element={<ProtectedRoute element={<Dashboard />} />}
/>

{/* Catch-all route */}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,11 @@ import {
VStack,
} from "@chakra-ui/react";

import { useAuthContext } from "../contexts/hooks/useAuthContext";
import { useBackendContext } from "../contexts/hooks/useBackendContext";
import { User } from "../types/users";
import { useAuthContext } from "../../contexts/hooks/useAuthContext";
import { useBackendContext } from "../../contexts/hooks/useBackendContext";
import { User } from "../../types/users";

export const DashboardPage = () => {
export const Dashboard = () => {
const { logout } = useAuthContext();
const { backend } = useBackendContext();

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,8 @@ import { FaGoogle } from "react-icons/fa6";
import { Link, useNavigate } from "react-router-dom";
import { z } from "zod";

import { auth, logInWithEmailAndPassWord } from "../utils/auth/firebase";
import { createGoogleUserInFirebase } from "../utils/auth/providers";
import { auth, logInWithEmailAndPassWord } from "../../utils/auth/firebase";
import { createGoogleUserInFirebase } from "../../utils/auth/providers";

const signinSchema = z.object({
email: z.string().email("Invalid email address"),
Expand All @@ -31,7 +31,7 @@ const signinSchema = z.object({

type SigninFormValues = z.infer<typeof signinSchema>;

export const LoginPage = () => {
export const Login = () => {
const navigate = useNavigate();
const toast = useToast();

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,9 @@ import { FaGoogle } from "react-icons/fa6";
import { Link, useNavigate } from "react-router-dom";
import { z } from "zod";

import { useAuthContext } from "../contexts/hooks/useAuthContext";
import { auth } from "../utils/auth/firebase";
import { createGoogleUserInFirebase } from "../utils/auth/providers";
import { useAuthContext } from "../../contexts/hooks/useAuthContext";
import { auth } from "../../utils/auth/firebase";
import { createGoogleUserInFirebase } from "../../utils/auth/providers";

const signupSchema = z.object({
email: z.string().email("Invalid email address"),
Expand All @@ -32,7 +32,7 @@ const signupSchema = z.object({

type SignupFormValues = z.infer<typeof signupSchema>;

export const SignupPage = () => {
export const Signup = () => {
const navigate = useNavigate();
const toast = useToast();
const { signup } = useAuthContext();
Expand Down

0 comments on commit f327cb5

Please sign in to comment.