-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #118 from nepalcodes/week_4
Worked on the daily quiz
- Loading branch information
Showing
3 changed files
with
36 additions
and
8 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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 ( | ||
<div | ||
className="daily-quiz-card bg-cover text-white p-8 rounded-lg" | ||
style={{ backgroundImage: `url(${backgroundImageUrl})` }} | ||
> | ||
<h1 className="mb-2">Nepalingo</h1> | ||
<p className="text-lg font-bold mb-2">QUIZ YOURSELF</p> | ||
<p className="text-sm opacity-80 mb-2"> | ||
Taking Quiz is a better and fun way for learning | ||
</p> | ||
<Button | ||
className="bg-slate-800" | ||
onClick={handleStartQuizClick} // Call the function on button click | ||
> | ||
Start Quiz | ||
</Button> | ||
</div> | ||
); | ||
}; | ||
|
||
export default DailyQuiz; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters