From b75759f4dc22cca33162811257d444eb69b96912 Mon Sep 17 00:00:00 2001 From: Aditya Bikram Thakur Date: Tue, 16 Jul 2024 15:58:45 +0545 Subject: [PATCH 1/5] updated the route from /learn to /flashcard --- nepalingo-web/src/App.tsx | 2 +- nepalingo-web/src/pages/Home/Home.tsx | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/nepalingo-web/src/App.tsx b/nepalingo-web/src/App.tsx index e889600..f72a290 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/pages/Home/Home.tsx b/nepalingo-web/src/pages/Home/Home.tsx index a9dd105..3f98373 100644 --- a/nepalingo-web/src/pages/Home/Home.tsx +++ b/nepalingo-web/src/pages/Home/Home.tsx @@ -42,7 +42,7 @@ const Home: React.FC = () => {
Learn Words From 21abc30a56c62f8673e6d3aa55812d17733e4127 Mon Sep 17 00:00:00 2001 From: Aditya Bikram Thakur Date: Tue, 16 Jul 2024 17:41:24 +0545 Subject: [PATCH 2/5] Created the daily quiz app --- nepalingo-web/src/components/DailyQuiz.tsx | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) create mode 100644 nepalingo-web/src/components/DailyQuiz.tsx diff --git a/nepalingo-web/src/components/DailyQuiz.tsx b/nepalingo-web/src/components/DailyQuiz.tsx new file mode 100644 index 0000000..e6f9b39 --- /dev/null +++ b/nepalingo-web/src/components/DailyQuiz.tsx @@ -0,0 +1,21 @@ +import React from 'react'; +import Button from './Button'; +const DailyQuiz: React.FC = () => { + const backgroundImageUrl = 'https://images8.alphacoders.com/132/1325725.png'; // Set your image URL + + return ( +
+

Nepalingo

+

QUIZ YOURSELF

+

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

+ +
+ ); +}; + +export default DailyQuiz; From 40fbf495ee5c20213ef266398979d06e7091cc70 Mon Sep 17 00:00:00 2001 From: Aditya Bikram Thakur Date: Tue, 16 Jul 2024 18:12:33 +0545 Subject: [PATCH 3/5] redirect to /flashcard when Start Quiz button is clicked --- nepalingo-web/src/components/DailyQuiz.tsx | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/nepalingo-web/src/components/DailyQuiz.tsx b/nepalingo-web/src/components/DailyQuiz.tsx index e6f9b39..6e4c225 100644 --- a/nepalingo-web/src/components/DailyQuiz.tsx +++ b/nepalingo-web/src/components/DailyQuiz.tsx @@ -1,7 +1,14 @@ import React from 'react'; +import { useNavigate } from 'react-router-dom'; // Import useNavigate import Button from './Button'; const DailyQuiz: React.FC = () => { const backgroundImageUrl = 'https://images8.alphacoders.com/132/1325725.png'; // Set your image URL + const navigate = useNavigate(); // Get the navigate function + + const handleStartQuizClick = () => { + // Redirect to /flashcard when the button is clicked + navigate('/flashcard'); + }; return (
{

Taking Quiz is a better and fun way for learning

- +
); }; From f894ad8a73617a4f4ce2e83ec4c3c207eb33d722 Mon Sep 17 00:00:00 2001 From: Aditya Bikram Thakur Date: Tue, 16 Jul 2024 20:51:14 +0545 Subject: [PATCH 4/5] Updated the home with quiz card and updated the route path of Flashcard component --- nepalingo-web/src/App.tsx | 2 +- nepalingo-web/src/components/DailyQuiz.tsx | 2 +- nepalingo-web/src/pages/Home/Home.tsx | 8 ++------ 3 files changed, 4 insertions(+), 8 deletions(-) diff --git a/nepalingo-web/src/App.tsx b/nepalingo-web/src/App.tsx index f72a290..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 index 6e4c225..f7f68ae 100644 --- a/nepalingo-web/src/components/DailyQuiz.tsx +++ b/nepalingo-web/src/components/DailyQuiz.tsx @@ -2,7 +2,7 @@ import React from 'react'; import { useNavigate } from 'react-router-dom'; // Import useNavigate import Button from './Button'; const DailyQuiz: React.FC = () => { - const backgroundImageUrl = 'https://images8.alphacoders.com/132/1325725.png'; // Set your image URL + 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 = () => { diff --git a/nepalingo-web/src/pages/Home/Home.tsx b/nepalingo-web/src/pages/Home/Home.tsx index 3f98373..4ccb271 100644 --- a/nepalingo-web/src/pages/Home/Home.tsx +++ b/nepalingo-web/src/pages/Home/Home.tsx @@ -4,6 +4,7 @@ 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 +42,7 @@ const Home: React.FC = () => {
- - Learn Words - +
); From 2bc84982529ced3d5c8e9876c5d55cd6c83f9681 Mon Sep 17 00:00:00 2001 From: Aditya Bikram Thakur Date: Wed, 17 Jul 2024 09:41:23 +0545 Subject: [PATCH 5/5] Fixed the lint issue --- nepalingo-web/src/pages/Home/Home.tsx | 1 - 1 file changed, 1 deletion(-) diff --git a/nepalingo-web/src/pages/Home/Home.tsx b/nepalingo-web/src/pages/Home/Home.tsx index 4ccb271..5c4dee7 100644 --- a/nepalingo-web/src/pages/Home/Home.tsx +++ b/nepalingo-web/src/pages/Home/Home.tsx @@ -1,5 +1,4 @@ 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";