Dad-Jokes is a React web application that fetches jokes from the Dad Jokes API and provides a fun way to enjoy and interact with dad jokes.
- Fetches jokes from the Dad Jokes API.
- Allows users to upvote and downvote jokes.
- Persists jokes and votes using
localStorage
, ensuring they remain even after refreshing the page. - Sorts jokes based on the number of votes, displaying the most popular ones at the top.
-
Fetching Jokes:
- The application retrieves jokes from the Dad Jokes API.
-
Storing Jokes and Votes:
- Jokes and user votes are stored in the browser's
localStorage
. - This enables the application to retain the jokes and their respective votes even after a page refresh.
- Jokes and user votes are stored in the browser's
-
Interacting with Jokes:
- Users can upvote or downvote jokes, influencing their sorting order.
- Jokes are displayed based on the number of votes, with the most popular jokes appearing first.
To run the Dad-Jokes application locally and explore its features:
-
Clone the repository:
git clone https://github.com/your-username/Dad-Jokes.git cd Dad-Jokes
-
Install dependencies:
npm install
-
Run the app:
npm start
-
Open http://localhost:3000 in your browser.
-
Enjoy the dad jokes, vote on your favorites, and witness them persist across sessions!
Contributions are welcome! If you'd like to contribute or report issues, please create a pull request or open an issue.
This project is licensed under the MIT License.
Feel free to modify and expand upon this README to better suit your project's specific details and structure!