Skip to content

Commit

Permalink
Merge pull request #17 from quizer-app/develop
Browse files Browse the repository at this point in the history
Restructure project & Fix quiz images & date
  • Loading branch information
EloToJaa authored Jan 9, 2024
2 parents 03e014d + 7a392c2 commit 746cdf3
Show file tree
Hide file tree
Showing 40 changed files with 159 additions and 162 deletions.
2 changes: 1 addition & 1 deletion src/api/axios.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import axios from "axios";

const baseURL =
export const baseURL =
(import.meta.env.VITE_API_URL as string) ?? "https://api.local.elotoja.com";

export const api = axios.create({
Expand Down
10 changes: 10 additions & 0 deletions src/api/types/quiz.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,13 @@
export type PaginatedQuizResponse = {
items: QuizResponse[];
pageNumber: number;
pageSize: number;
totalCount: number;
totalPages: number;
hasNextPage: boolean;
hasPreviousPage: boolean;
};

export type QuizResponse = {
id: string;
userId: string;
Expand Down
File renamed without changes.
27 changes: 12 additions & 15 deletions src/components/App.tsx
Original file line number Diff line number Diff line change
@@ -1,18 +1,16 @@
import { Route, Routes } from "react-router-dom";
import Layout from "./layout/Layout";
import Flashcards from "./layout/Quiz/Flashcards";
import Quiz from "./layout/Quiz/Quiz";
import Test from "./layout/Quiz/Test";
import ForgotPassword from "./page/ForgotPassword";
import Home from "./page/Home";
import PasswordReset from "./page/PasswordReset";
import SignIn from "./page/SignIn";
import SignUp from "./page/SignUp";
import Users from "./page/Users";
import Verification from "./page/Verification";
import Verified from "./page/Verified";
import ForgotPassword from "./pages/Auth/ForgotPassword";
import PasswordReset from "./pages/Auth/PasswordReset";
import SignIn from "./pages/Auth/SignIn";
import SignUp from "./pages/Auth/SignUp";
import Verification from "./pages/Auth/Verification";
import Verified from "./pages/Auth/Verified";
import Home from "./pages/Home/Home";
import Flashcards from "./pages/Quiz/Flashcards";
import Quiz from "./pages/Quiz/Quiz";
import Test from "./pages/Quiz/Test";
import PersistLogin from "./router/PersistLogin";
import RequireAuth from "./router/RequireAuth";
import NotFound from "./status/NotFound";

export default function App() {
Expand All @@ -28,10 +26,9 @@ export default function App() {
<Route path="/password_reset" element={<PasswordReset />} />
<Route path="/forgot_password" element={<ForgotPassword />} />

{/* <Route path="/flashcards" element={<Flashcards />} /> */}
<Route element={<RequireAuth />}>
{/* <Route element={<RequireAuth />}>
<Route path="/users" element={<Users />} />
</Route>
</Route> */}

<Route path="/:userName/:quizSlug" element={<Quiz />} />

Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import MainLogo from "@/assets/images/light.png";
import { X } from "lucide-react";
import { Link } from "react-router-dom";
import DarkModeButton from "../Header/DarkModeButton";
import Logo from "../Header/Logo";
import DarkModeButton from "./DarkModeButton";
import Logo from "./Logo";

interface QuizHeaderProps {
name: string;
Expand Down
2 changes: 1 addition & 1 deletion src/components/layout/Layout.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { Outlet } from "react-router-dom";
import { Header } from "./Header/Header";
import { Toaster } from "react-hot-toast";
import Footer from "./Sections/Footer/Footer";
import Footer from "./Footer/Footer";

export default function Layout() {
return (
Expand Down
2 changes: 1 addition & 1 deletion src/components/layout/QuizLayout.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { Toaster } from "react-hot-toast";
import { Outlet } from "react-router-dom";
import QuizHeader from "./Quiz/QuizHeader";
import QuizHeader from "./Header/QuizHeader";

export default function QuizLayout() {
return (
Expand Down
13 changes: 0 additions & 13 deletions src/components/page/Home.tsx

This file was deleted.

44 changes: 0 additions & 44 deletions src/components/page/Users.tsx

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
import { Link } from "react-router-dom";
import { Button } from "../layout/ContentBox/Button";
import ContentBox from "../layout/ContentBox/ContentBox";
import WarningIcon from "../layout/ContentBox/SvgIcons/WarningIcon";
import Text from "../layout/ContentBox/Text";
import Title from "../layout/ContentBox/Title";
import FillHeight from "../layout/Other/FillHeight";
import { Button } from "../../layout/ContentBox/Button";
import ContentBox from "../../layout/ContentBox/ContentBox";
import WarningIcon from "../../layout/ContentBox/Icons/WarningIcon";
import Text from "../../layout/ContentBox/Text";
import Title from "../../layout/ContentBox/Title";
import FillHeight from "../../layout/Other/FillHeight";

export default function ForgotPassword() {
return (
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import { Button } from "../layout/ContentBox/Button";
import ContentBox from "../layout/ContentBox/ContentBox";
import LockIcon from "../layout/ContentBox/SvgIcons/LockIcon";
import Text from "../layout/ContentBox/Text";
import Title from "../layout/ContentBox/Title";
import FillHeight from "../layout/Other/FillHeight";
import { Button } from "../../layout/ContentBox/Button";
import ContentBox from "../../layout/ContentBox/ContentBox";
import LockIcon from "../../layout/ContentBox/Icons/LockIcon";
import Text from "../../layout/ContentBox/Text";
import Title from "../../layout/ContentBox/Title";
import FillHeight from "../../layout/Other/FillHeight";

export default function PasswordReset() {
return (
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,15 +13,15 @@ import {
accessTokenAtom,
isAuthenticatedAtom,
persistAtom,
} from "../../atoms/auth";
import { Button } from "../layout/ContentBox/Button";
import ContentBox from "../layout/ContentBox/ContentBox";
import { FormInput } from "../layout/ContentBox/FormInput";
import GoogleButton from "../layout/ContentBox/GoogleButton";
import Text from "../layout/ContentBox/Text";
import TextWithLines from "../layout/ContentBox/TextWithLines";
import TextWithLink from "../layout/ContentBox/TextWithLink";
import Title from "../layout/ContentBox/Title";
} from "../../../atoms/auth";
import { Button } from "../../layout/ContentBox/Button";
import ContentBox from "../../layout/ContentBox/ContentBox";
import { FormInput } from "../../layout/ContentBox/FormInput";
import GoogleButton from "../../layout/ContentBox/GoogleButton";
import Text from "../../layout/ContentBox/Text";
import TextWithLines from "../../layout/ContentBox/TextWithLines";
import TextWithLink from "../../layout/ContentBox/TextWithLink";
import Title from "../../layout/ContentBox/Title";

const schema = z.object({
usernameOrEmail: z.string().min(1),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,14 +10,14 @@ import { useForm } from "react-hook-form";
import { toast } from "react-hot-toast/headless";
import { useNavigate } from "react-router-dom";
import { z } from "zod";
import { Button } from "../layout/ContentBox/Button";
import ContentBox from "../layout/ContentBox/ContentBox";
import { FormInput } from "../layout/ContentBox/FormInput";
import GoogleButton from "../layout/ContentBox/GoogleButton";
import Text from "../layout/ContentBox/Text";
import TextWithLines from "../layout/ContentBox/TextWithLines";
import TextWithLink from "../layout/ContentBox/TextWithLink";
import Title from "../layout/ContentBox/Title";
import { Button } from "../../layout/ContentBox/Button";
import ContentBox from "../../layout/ContentBox/ContentBox";
import { FormInput } from "../../layout/ContentBox/FormInput";
import GoogleButton from "../../layout/ContentBox/GoogleButton";
import Text from "../../layout/ContentBox/Text";
import TextWithLines from "../../layout/ContentBox/TextWithLines";
import TextWithLink from "../../layout/ContentBox/TextWithLink";
import Title from "../../layout/ContentBox/Title";

const schema = z.object({
username: z.string().min(3).max(32),
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import { Button } from "../layout/ContentBox/Button";
import ContentBox from "../layout/ContentBox/ContentBox";
import EmailIcon from "../layout/ContentBox/SvgIcons/EmailIcon";
import Text from "../layout/ContentBox/Text";
import Title from "../layout/ContentBox/Title";
import FillHeight from "../layout/Other/FillHeight";
import { Button } from "../../layout/ContentBox/Button";
import ContentBox from "../../layout/ContentBox/ContentBox";
import EmailIcon from "../../layout/ContentBox/Icons/EmailIcon";
import Text from "../../layout/ContentBox/Text";
import Title from "../../layout/ContentBox/Title";
import FillHeight from "../../layout/Other/FillHeight";

export default function Verification() {
// const { token } = useParams();
Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
import ContentBox from "../layout/ContentBox/ContentBox";
import Title from "../layout/ContentBox/Title";
import Text from "../layout/ContentBox/Text";
import { Button } from "../layout/ContentBox/Button";
import FillHeight from "../layout/Other/FillHeight";
import ContentBox from "../../layout/ContentBox/ContentBox";
import Title from "../../layout/ContentBox/Title";
import Text from "../../layout/ContentBox/Text";
import { Button } from "../../layout/ContentBox/Button";
import FillHeight from "../../layout/Other/FillHeight";
import { Link } from "react-router-dom";
import CheckmarkIcon from "../layout/ContentBox/SvgIcons/CheckmarkIcon";
import CheckmarkIcon from "../../layout/ContentBox/Icons/CheckmarkIcon";

export default function Verified() {
return (
Expand Down
13 changes: 13 additions & 0 deletions src/components/pages/Home/Home.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
import Features from "./Features/Features";
import Intro from "./Intro/Intro";
import TileGrid from "./TileGrid/TileGrid";

export default function Home() {
return (
<>
<Intro />
<Features />
<TileGrid />
</>
);
}
Original file line number Diff line number Diff line change
Expand Up @@ -47,8 +47,8 @@ export default function Bottom() {
y2="212.24"
gradientUnits="userSpaceOnUse"
>
<stop stop-color="#4A6CF7" stop-opacity="0"></stop>
<stop offset="1" stop-color="#4A6CF7"></stop>
<stop stopColor="#4A6CF7" stopOpacity="0"></stop>
<stop offset="1" stopColor="#4A6CF7"></stop>
</linearGradient>
<linearGradient
id="paint1_linear_25:218"
Expand All @@ -58,8 +58,8 @@ export default function Bottom() {
y2="212.24"
gradientUnits="userSpaceOnUse"
>
<stop stop-color="#4A6CF7" stop-opacity="0"></stop>
<stop offset="1" stop-color="#4A6CF7"></stop>
<stop stopColor="#4A6CF7" stopOpacity="0"></stop>
<stop offset="1" stopColor="#4A6CF7"></stop>
</linearGradient>
<linearGradient
id="paint2_linear_25:218"
Expand All @@ -69,8 +69,8 @@ export default function Bottom() {
y2="212.24"
gradientUnits="userSpaceOnUse"
>
<stop stop-color="#4A6CF7" stop-opacity="0"></stop>
<stop offset="1" stop-color="#4A6CF7"></stop>
<stop stopColor="#4A6CF7" stopOpacity="0"></stop>
<stop offset="1" stopColor="#4A6CF7"></stop>
</linearGradient>
<linearGradient
id="paint3_linear_25:218"
Expand All @@ -80,8 +80,8 @@ export default function Bottom() {
y2="210.214"
gradientUnits="userSpaceOnUse"
>
<stop stop-color="#4A6CF7" stop-opacity="0"></stop>
<stop offset="1" stop-color="#4A6CF7"></stop>
<stop stopColor="#4A6CF7" stopOpacity="0"></stop>
<stop offset="1" stopColor="#4A6CF7"></stop>
</linearGradient>
<linearGradient
id="paint4_linear_25:218"
Expand All @@ -91,8 +91,8 @@ export default function Bottom() {
y2="99.5816"
gradientUnits="userSpaceOnUse"
>
<stop stop-color="#4A6CF7"></stop>
<stop offset="1" stop-color="#4A6CF7" stop-opacity="0"></stop>
<stop stopColor="#4A6CF7"></stop>
<stop offset="1" stopColor="#4A6CF7" stopOpacity="0"></stop>
</linearGradient>
<radialGradient
id="paint5_radial_25:218"
Expand All @@ -102,8 +102,8 @@ export default function Bottom() {
gradientUnits="userSpaceOnUse"
gradientTransform="translate(220 63) rotate(90) scale(43)"
>
<stop offset="0.145833" stop-color="white" stop-opacity="0"></stop>
<stop offset="1" stop-color="white" stop-opacity="0.08"></stop>
<stop offset="0.145833" stopColor="white" stopOpacity="0"></stop>
<stop offset="1" stopColor="white" stopOpacity="0.08"></stop>
</radialGradient>
</defs>
</svg>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import Bottom from "@/components/svg/main/Bottom";
import Top from "@/components/svg/main/Top";
import Bottom from "@/components/pages/Home/Intro/Bottom";
import Top from "@/components/pages/Home/Intro/Top";

export default function Intro() {
return (
Expand Down
Loading

0 comments on commit 746cdf3

Please sign in to comment.