Skip to content
New issue

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

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

Already on GitHub? # to your account

fix:Replace <a> tags with <Link> components for proper client-side routing #204

Open
wants to merge 2 commits into
base: main
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
22 changes: 18 additions & 4 deletions eduaid_web/package-lock.json

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

9 changes: 5 additions & 4 deletions eduaid_web/src/pages/Home.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import starsImg from "../assets/stars.png";
import arrow from "../assets/arrow.png";
import gitStar from "../assets/gitStar.png";
import { FaGithub } from "react-icons/fa";
import { Link } from "react-router-dom";

const Home = () => {
const [stars, setStars] = useState(null);
Expand Down Expand Up @@ -92,20 +93,20 @@ const Home = () => {
</div>
<div className="flex justify-center gap-6">
<div className="mt-8 rounded-2xl">
<a href="question-type">
<Link to={'question-type'}>
<button className="items-center text-lg flex justify-center gap-4 text-white px-6 py-3 mx-auto mt-6 border-gradient hover:wave-effect rounded-md">
Let’s get Started{" "}
<img src={arrow} width={28} height={24} alt="" />
</button>
</a>
</Link>
</div>
<div className="mt-8 rounded-2xl">
<a href="history">
<Link to={"history"}>
<button className="items-center text-lg flex justify-center gap-4 text-white px-6 py-3 mx-auto mt-6 border-gradient hover:wave-effect rounded-md">
Your previous Work!
<img src={arrow} width={28} height={24} alt="" />
</button>
</a>
</Link>
</div>
</div>
<a
Expand Down
5 changes: 3 additions & 2 deletions eduaid_web/src/pages/Output.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import { PDFDocument, rgb } from "pdf-lib";
import "../index.css";
import logo from "../assets/aossie_logo.png";
import logoPNG from "../assets/aossie_logo_transparent.png";
import { Link } from "react-router-dom";


const Output = () => {
Expand Down Expand Up @@ -347,7 +348,7 @@ const Output = () => {
<div className="popup w-full h-full bg-[#02000F] flex justify-center items-center">
<div className="w-full h-full bg-cust bg-opacity-50 bg-custom-gradient">
<div className="flex flex-col h-full">
<a href="/">
<Link to={"/"}>
<div className="flex items-end gap-[2px]">
<img src={logo} alt="logo" className="w-16 my-4 ml-4 block" />
<div className="text-2xl mb-3 font-extrabold">
Expand All @@ -359,7 +360,7 @@ const Output = () => {
</span>
</div>
</div>
</a>
</Link>
<div className="font-bold text-xl text-white mt-3 mx-2">
Generated Questions
</div>
Expand Down
5 changes: 3 additions & 2 deletions eduaid_web/src/pages/Previous.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import "../index.css";
import logo from "../assets/aossie_logo.png";
import stars from "../assets/stars.png";
import { FaArrowRight } from "react-icons/fa";
import { Link } from "react-router-dom";

const Previous = () => {
const getQuizzesFromLocalStorage = () => {
Expand All @@ -29,7 +30,7 @@ const Previous = () => {
return (
<div className="popup w-screen h-screen bg-[#02000F] flex flex-col justify-center items-center">
<div className="w-full h-full bg-cust bg-opacity-50 bg-custom-gradient">
<a href="/">
<Link to={"/"}>
<div className="flex items-end gap-[2px]">
<img src={logo} alt="logo" className="w-16 my-4 ml-4 block" />
<div className="text-2xl mb-3 font-extrabold">
Expand All @@ -41,7 +42,7 @@ const Previous = () => {
</span>
</div>
</div>
</a>
</Link>
<div className="text-right mt-[-8px] mx-1">
<div className="text-white text-xl font-bold">Quiz Dashboard</div>
<div className="text-white text-right justify-end flex gap-2 text-xl font-bold">
Expand Down
9 changes: 5 additions & 4 deletions eduaid_web/src/pages/Question_Type.jsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import React, { useState } from "react";
import "../index.css";
import logo from "../assets/aossie_logo.png";
import { Link } from "react-router-dom";

const Question_Type = () => {
const [selectedOption, setSelectedOption] = useState(null);
Expand All @@ -18,7 +19,7 @@ const Question_Type = () => {
return (
<div className="popup w-screen h-screen bg-[#02000F] flex justify-center items-center">
<div className="w-full h-full bg-cust bg-opacity-50 bg-custom-gradient p-6">
<a href="/">
<Link to={"/"}>
<div className="flex items-end gap-4">
<img src={logo} alt="logo" className="w-24 my-6 block" />
<div className="text-5xl mb-5 font-extrabold">
Expand All @@ -30,7 +31,7 @@ const Question_Type = () => {
</span>
</div>
</div>
</a>
</Link>
<div className="text-4xl mt-6 text-white text-center font-extrabold">
What’s on your Mind?
</div>
Expand Down Expand Up @@ -99,14 +100,14 @@ const Question_Type = () => {
</div>
<div className="mx-auto text-center mt-10">
{selectedOption ? (
<a href="input">
<Link to={"/input"}>
<button
onClick={handleSaveToLocalStorage}
className="rounded-2xl text-2xl text-white w-fit px-8 font-bold py-3 bg-gradient-to-r from-[#FF005C] via-[#7600F2] to-[#00CBE7]"
>
Fire Up{" "}🚀
</button>
</a>
</Link>
) : (
<button
onClick={() => alert("Please select a question type.")}
Expand Down
42 changes: 22 additions & 20 deletions eduaid_web/src/pages/Text_Input.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import stars from "../assets/stars.png";
import cloud from "../assets/cloud.png";
import { FaClipboard } from "react-icons/fa";
import Switch from "react-switch";
import { Link } from "react-router-dom";

const Text_Input = () => {
const [text, setText] = useState("");
Expand Down Expand Up @@ -169,26 +170,27 @@ const Text_Input = () => {
</div>
)}
<div
className={`w-full h-full bg-cust bg-opacity-50 ${
loading ? "pointer-events-none" : ""
}`}
className={`w-full h-full bg-cust bg-opacity-50 ${loading ? "pointer-events-none" : ""
}`}
>
<a href="/">
<div className="flex items-end gap-[2px]">
<img src={logo} alt="logo" className="w-24 my-6 ml-6 block" />
<div className="text-4xl mb-5 font-extrabold">
<span className="bg-gradient-to-r from-[#FF005C] to-[#7600F2] text-transparent bg-clip-text">
Edu
</span>
<span className="bg-gradient-to-r from-[#7600F2] to-[#00CBE7] text-transparent bg-clip-text">
Aid
</span>
<div className="flex items-end gap-[2px]">
<Link to={"/"}>
<div className="flex gap-x-2">
<img src={logo} alt="logo" className="w-24 my-6 ml-6 block" />
<div className="text-4xl mb-5 font-extrabold self-end">
<span className="bg-gradient-to-r from-[#FF005C] to-[#7600F2] text-transparent bg-clip-text">
Edu
</span>
<span className="bg-gradient-to-r from-[#7600F2] to-[#00CBE7] text-transparent bg-clip-text">
Aid
</span>
</div>
</div>
</div>
</a>
<div className="text-right mt-[-8px] mx-1">
<div className="text-white text-xl font-bold">Enter the Content</div>
<div className="text-white text-right justify-end flex gap-2 text-xl font-bold">
</Link>
</div>
<div className="mt-[-8px] mx-1 flex flex-col items-center justify-center">
<div className="text-white text-xl font-bold w-fit">Enter the Content</div>
<div className="text-white flex gap-2 text-xl font-bold w-fit">
to Generate{" "}
<span className="bg-gradient-to-r from-[#7600F2] to-[#00CBE7] text-transparent bg-clip-text">
Questionaries
Expand Down Expand Up @@ -294,11 +296,11 @@ const Text_Input = () => {
</div>
</div>
<div className="flex justify-center gap-8 my-6">
<a href="question-type">
<Link to={"question-type"}>
<button className="bg-black items-center text-xl text-white px-4 py-2 border-gradient">
Back
</button>
</a>
</Link>
{/* <a href="output"> */}
<button
onClick={handleSaveToLocalStorage}
Expand Down