diff --git a/nepalingo-web/src/App.tsx b/nepalingo-web/src/App.tsx index e889600..87cb5e8 100644 --- a/nepalingo-web/src/App.tsx +++ b/nepalingo-web/src/App.tsx @@ -20,7 +20,7 @@ const App: React.FC = () => { } /> - } /> + :} /> {/* Protect the / route, redirect to /login if not authenticated */} : } /> {/* Default route redirects to /login */} diff --git a/nepalingo-web/src/components/DailyQuiz.tsx b/nepalingo-web/src/components/DailyQuiz.tsx new file mode 100644 index 0000000..f7f68ae --- /dev/null +++ b/nepalingo-web/src/components/DailyQuiz.tsx @@ -0,0 +1,33 @@ +import React from 'react'; +import { useNavigate } from 'react-router-dom'; // Import useNavigate +import Button from './Button'; +const DailyQuiz: React.FC = () => { + const backgroundImageUrl = 'https://t3.ftcdn.net/jpg/00/73/08/22/360_F_73082224_ay4Tus31QNHNmGSIty53ZE6mBrBc47cV.jpg'; // Set your image URL + const navigate = useNavigate(); // Get the navigate function + + const handleStartQuizClick = () => { + // Redirect to /flashcard when the button is clicked + navigate('/flashcard'); + }; + + return ( +
+

Nepalingo

+

QUIZ YOURSELF

+

+ Taking Quiz is a better and fun way for learning +

+ +
+ ); +}; + +export default DailyQuiz; diff --git a/nepalingo-web/src/pages/Home/Home.tsx b/nepalingo-web/src/pages/Home/Home.tsx index a9dd105..5c4dee7 100644 --- a/nepalingo-web/src/pages/Home/Home.tsx +++ b/nepalingo-web/src/pages/Home/Home.tsx @@ -1,9 +1,9 @@ import React from "react"; -import { Link } from "react-router-dom"; import logo from "../../assets/logo.png"; import Header from "../../components/header/Header"; import ReactGA from "react-ga4"; import { useAuth } from "../../components/userAuth/AuthContext"; +import DailyQuiz from "../../components/DailyQuiz"; const Home: React.FC = () => { ReactGA.send({ @@ -41,12 +41,7 @@ const Home: React.FC = () => {
- - Learn Words - +
);