Skip to content

Commit

Permalink
Updated the home with quiz card and updated the route path of Flashca…
Browse files Browse the repository at this point in the history
…rd component
  • Loading branch information
sirElvin committed Jul 16, 2024
1 parent 40fbf49 commit f894ad8
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 8 deletions.
2 changes: 1 addition & 1 deletion nepalingo-web/src/App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ const App: React.FC = () => {
<Router>
<Routes>
<Route path="/login" element={<User_auth />} />
<Route path="/flashcard" element={<FlashcardPage />} />
<Route path="/flashcard" element={user ? <FlashcardPage />:<Navigate to="/login" />} />
{/* Protect the / route, redirect to /login if not authenticated */}
<Route path="/" element={user ? <Home /> : <Navigate to="/login" />} />
{/* Default route redirects to /login */}
Expand Down
2 changes: 1 addition & 1 deletion nepalingo-web/src/components/DailyQuiz.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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 = () => {
Expand Down
8 changes: 2 additions & 6 deletions nepalingo-web/src/pages/Home/Home.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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({
Expand Down Expand Up @@ -41,12 +42,7 @@ const Home: React.FC = () => {
</div>
</div>
<div className="mb-10">
<Link
to="/flashcard"
className="text-xl font-bold p-5 border-2 border-white rounded-full"
>
Learn Words
</Link>
<DailyQuiz />
</div>
</div>
);
Expand Down

0 comments on commit f894ad8

Please sign in to comment.