Skip to content

Commit

Permalink
add routes
Browse files Browse the repository at this point in the history
  • Loading branch information
thaboRach committed Sep 10, 2024
1 parent 6407aef commit ea3ff6c
Show file tree
Hide file tree
Showing 16 changed files with 266 additions and 136 deletions.
6 changes: 4 additions & 2 deletions src/assets/dashboard.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
6 changes: 4 additions & 2 deletions src/assets/home.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion src/components/Logo.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ const LogoHolder = ({ size = "large" }: LogoProps) => {
"w-[95px] h-[95px]": size === "large",
"w-[50px] h-[50px]": size === "small",
});
return <div className={logoClass}></div>;
return <div className={logoClass} />;
};

export default LogoHolder;
108 changes: 0 additions & 108 deletions src/pages/Dashboard.tsx

This file was deleted.

8 changes: 4 additions & 4 deletions src/pages/Home.tsx → src/pages/HomePage.tsx
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
import { useNavigate } from "react-router-dom";
import Button from "../components/Button";

const Home = () => {
const HomePage = () => {
const navigate = useNavigate();

return (
<main className="flex flex-col gap-y-2 items-center justify-center w-full h-screen bg-gradient-to-r from-purple-500 to-pink-500">
<h1 className="text-white text-3xl text-medium">Choose an option</h1>
<main className="flex flex-col items-center justify-center w-full h-screen gap-y-2 bg-gradient-to-r from-purple-500 to-pink-500">
<h1 className="text-3xl text-white text-medium">Choose an option</h1>
<div className="flex gap-2 max-w-[400px] w-full">
<Button onClick={() => navigate("/normal")}>Normal</Button>
<Button onClick={() => navigate("/formik")}>Formik</Button>
Expand All @@ -15,4 +15,4 @@ const Home = () => {
);
};

export default Home;
export default HomePage;
12 changes: 6 additions & 6 deletions src/pages/Login.tsx → src/pages/LoginPage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import LoginFormikForm from "../forms/LoginFormikForm";
import { ILoginForm } from "../types";
import { LoginSchema } from "../utils/schemas";

const Login = () => {
const LoginPage = () => {
const { setActiveTab } = useContext(TabsContext);
const location = useLocation();
const navigate = useNavigate();
Expand All @@ -20,7 +20,7 @@ const Login = () => {
function handleSubmit(values: ILoginForm) {
window.alert(JSON.stringify(values));

navigate("/dashboard");
navigate("/main");
}

return (
Expand All @@ -37,16 +37,16 @@ const Login = () => {
)}
<div className="flex items-center justify-center gap-1 mt-auto border-t border-white max-w-[600px] w-full py-10">
<p className="text-white opacity-50">NEW USER?</p>
{/* rome-ignore lint/a11y/useKeyWithClickEvents: <explanation> */}
<p
<button
type="button"
onClick={() => setActiveTab("signUp")}
className="text-white underline cursor-pointer"
>
SIGN UP
</p>
</button>
</div>
</section>
);
};

export default Login;
export default LoginPage;
8 changes: 4 additions & 4 deletions src/pages/Onboarding.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import Logo from "../components/Logo";
import Arrow from "../assets/arrow.svg";
import Login from "./Login";
import LoginPage from "./LoginPage";
import SignUp from "./SignUp";
import Tabbed from "../components/Tabbed";
import { TabsContextProvider } from "../context/tabs-context";
Expand All @@ -11,14 +11,14 @@ interface OnboardingProps {
}

const options = [
{ value: "login", component: <Login /> },
{ value: "login", component: <LoginPage /> },
{ value: "signUp", component: <SignUp /> },
];

const Onboarding = ({ onBack }: OnboardingProps) => {
return (
<main className="w-full h-screen flex flex-col items-center gap-10 bg-gradient-to-r from-purple-500 to-pink-500">
<div className="w-full flex justify-center pt-10 relative">
<main className="flex flex-col items-center w-full h-screen gap-10 bg-gradient-to-r from-purple-500 to-pink-500">
<div className="relative flex justify-center w-full pt-10">
{/* rome-ignore lint/a11y/useKeyWithClickEvents: <explanation> */}
<img
className="w-[30px] h-[30px] cursor-pointer absolute left-6"
Expand Down
6 changes: 3 additions & 3 deletions src/pages/SignUp.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -38,13 +38,13 @@ const SignUp = () => {
)}
<div className="flex items-center justify-center gap-1 mt-auto border-t border-white max-w-[600px] w-full py-10">
<p className="text-white opacity-50">ALREADY DID THIS?</p>
{/* rome-ignore lint/a11y/useKeyWithClickEvents: <explanation> */}
<p
<button
type="button"
onClick={() => setActiveTab("login")}
className="text-white underline cursor-pointer"
>
LOGIN
</p>
</button>
</div>
</section>
);
Expand Down
9 changes: 9 additions & 0 deletions src/pages/main/Calendar.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
function Calendar() {
return (
<main className="flex-1 w-full bg-[#222] p-10">
<h1 className="text-2xl text-white">Welcome to your calendar</h1>
</main>
);
}

export default Calendar;
9 changes: 9 additions & 0 deletions src/pages/main/Dashboard.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
function Dashboard() {
return (
<main className="flex-1 w-full bg-[#222] p-10">
<h1 className="text-2xl text-white">Welcome to the Dashboard</h1>
</main>
);
}

export default Dashboard;
9 changes: 9 additions & 0 deletions src/pages/main/Home.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
function Home() {
return (
<main className="flex-1 w-full bg-[#222] p-10">
<h1 className="text-2xl text-white">Welcome Home</h1>
</main>
);
}

export default Home;
Loading

0 comments on commit ea3ff6c

Please sign in to comment.