diff --git a/src/common/home/Home.jsx b/src/common/home/Home.jsx
index 27727dbba5..02eb350a80 100644
--- a/src/common/home/Home.jsx
+++ b/src/common/home/Home.jsx
@@ -1,24 +1,32 @@
-import { useState, useEffect } from "react";
-import useFetch from 'common/hooks/useFetch';
+import { useState, useEffect, useContext } from "react";
+import useFetch from "common/hooks/useFetch";
import { Link } from "react-router-dom";
import "./home.css";
import { RiSlideshow4Line } from "react-icons/ri";
import { BiShareAlt, BiAddToQueue } from "react-icons/bi";
-import { BsGithub } from 'react-icons/bs';
+import { BsGithub } from "react-icons/bs";
import { FiStar } from "react-icons/fi";
import { ReactComponent as Flower } from "images/icon-flower.svg";
import { MdManageSearch } from "react-icons/md";
import YoutubeVideoEmbed from 'common/components/YouTubeEmbed';
import FeaturedPlays from "common/playlists/FeaturedPlays";
import Contributors from "./Contributors";
+import { SearchContext } from "common/search/search-context";
const Home = () => {
- const [gitHubStars, setGitHubStars] = useState('...');
- const { data } = useFetch('https://api.github.com/repos/atapas/react-play');
-
+ const [gitHubStars, setGitHubStars] = useState("...");
+ const { data } = useFetch("https://api.github.com/repos/atapas/react-play");
+ const { setSearchTerm, searchTerm, setFilterQuery } =
+ useContext(SearchContext);
useEffect(() => {
setGitHubStars(data.stargazers_count);
- }, [data]);
+ setSearchTerm("");
+ setFilterQuery({
+ level: "",
+ tags: [],
+ creator: "",
+ });
+ }, [data, setSearchTerm, searchTerm]);
return (
@@ -34,8 +42,9 @@ const Home = () => {
with ReactPlay
- ReactPlay is an open-source application to learn, create and share ReactJS
- projects with the developer community. Start by browsing the plays or exploring the source code.
+ ReactPlay is an open-source application to learn, create and share
+ ReactJS projects with the developer community. Start by browsing the
+ plays or exploring the source code.
Learn how to "Think in React" and build applications inspired by
several plays(source code & demos). Get to the source code of it,
- find related article, or even a YouTube video. Learn from the expert
- code reviews.
+ find related article, or even a YouTube video. Learn from the
+ expert code reviews.
@@ -80,10 +94,10 @@ const Home = () => {
Create
- Create your own plays and own them by following a few simple steps.
- Learned something new? Perfect to present as a play. You can also
- contribute to the existing plays. Your play will be reviewed by the
- experts before being made public.
+ Create your own plays and own them by following a few simple
+ steps. Learned something new? Perfect to present as a play. You
+ can also contribute to the existing plays. Your play will be
+ reviewed by the experts before being made public.
@@ -92,8 +106,8 @@ const Home = () => {
Socialize
- Share your plays with the community. The best way of building in public
- is by sharing the learning. You can share your plays on
+ Share your plays with the community. The best way of building in
+ public is by sharing the learning. You can share your plays on
social media platforms like Facebook, Twitter, LinkedIn, to name a
few, just with a single click.