diff --git a/package.json b/package.json index 93d4f78def..e65fc3fa7e 100644 --- a/package.json +++ b/package.json @@ -3,9 +3,6 @@ "version": "1.0.0", "private": true, "dependencies": { - "@testing-library/jest-dom": "^5.14.1", - "@testing-library/react": "^12.0.0", - "@testing-library/user-event": "^13.2.1", "plop": "^3.0.5", "react": "^18.0.0", "react-dom": "^18.0.0", diff --git a/src/common/home/Home.jsx b/src/common/home/Home.jsx index 02eb350a80..c406413eea 100644 --- a/src/common/home/Home.jsx +++ b/src/common/home/Home.jsx @@ -26,7 +26,7 @@ const Home = () => { tags: [], creator: "", }); - }, [data, setSearchTerm, searchTerm]); + }, [data, setSearchTerm, searchTerm, setFilterQuery]); return (
diff --git a/src/index.js b/src/index.js index bfdeb0880e..0eba3eb35d 100644 --- a/src/index.js +++ b/src/index.js @@ -2,7 +2,7 @@ import RouteDefs from "common/routing/RouteDefs"; import { SearchContext } from "common/search/search-context"; import "index.css"; import React, { useState } from "react"; -import { createRoot } from "react-dom/client"; +import { createRoot } from 'react-dom/client'; import reportWebVitals from "reportWebVitals"; const Index = () => { diff --git a/src/meta/play-meta.js b/src/meta/play-meta.js index 7ad09d69bd..22057fdc9a 100644 --- a/src/meta/play-meta.js +++ b/src/meta/play-meta.js @@ -8,6 +8,7 @@ import { States, SocialCard, RandomMemeGenerator, + Keeper, ReactTodoApp, ExpandingCards, AnalogClock, @@ -81,69 +82,64 @@ export const plays = [ tags: "Recursion, Tree", github: "green-roots", featured: true, - }, - { - id: "pl-counter", - name: "Counter", - description: - "A simple counter which increments the value upto a certain limit!", - component: () => { - return ; - }, - path: "/plays/counter", - level: "Beginner", - tags: "JSX, State, Props", - github: "murtuzaalisurti" - }, - { - id: "pl-states", - name: "States", - description: "States in Functional Components", - component: () => { - return ; - }, - path: "/plays/states", - level: "Beginner", - tags: "Hooks,State,JSX", - github: "Abhishek-90", - cover: "", - blog: "https://abhishek-90.github.io/My-Portfolio/", - }, - { - id: "pl-social-card", - name: "Social Card", - description: - "The Social Card helps you telling who you are using photo, name, and other social footprints.", - component: () => { - return ; - }, - path: "/plays/social-card", - level: "Intermediate", - tags: "Form,Events,Complex State", - github: "atapas", - featured: true, - cover: "", - blog: "https://blog.greenroots.info/how-to-create-react-form-with-a-single-change-event-handler", - video: "", - }, - { - id: "pl-random-meme-generator", - name: "Random Meme Generator", - description: - "A project to demonstrate the use of API to fetch random memes! It also demonstrates how you can do event handling!", - component: () => { - return ; - }, - path: "/plays/random-meme-generator", - level: "Beginner", - tags: "JSX,Hooks,API,EventHandling", - github: "murtuzaalisurti", - featured: true, - cover: "", - blog: "", - video: "", - }, - { + }, { + id: 'pl-counter', + name: 'Counter', + description: 'A simple counter which increments the value upto a certain limit!', + component: () => {return }, + path: '/plays/counter', + level: 'Beginner', + tags: 'JSX, State, Props', + github: 'murtuzaalisurti', + featured: true + }, { + id: 'pl-states', + name: 'States', + description: 'States in Functional Components', + component: () => {return }, + path: '/plays/states', + level: 'Beginner', + tags: 'Hooks,State,JSX', + github: 'Abhishek-90', + cover: '', + blog: 'https://abhishek-90.github.io/My-Portfolio/' + }, { + id: 'pl-social-card', + name: 'Social Card', + description: 'The Social Card helps you telling who you are using photo, name, and other social footprints.', + component: () => {return }, + path: '/plays/social-card', + level: 'Intermediate', + tags: 'Form,Events,Complex State', + github: 'atapas', + cover: '', + blog: 'https://blog.greenroots.info/how-to-create-react-form-with-a-single-change-event-handler', + video: '' + }, { + id: 'pl-random-meme-generator', + name: 'Random Meme Generator', + description: 'A project to demonstrate the use of API to fetch random memes! It also demonstrates how you can do event handling!', + component: () => {return }, + path: '/plays/random-meme-generator', + level: 'Beginner', + tags: 'JSX,Hooks,API,EventHandling', + github: 'murtuzaalisurti', + cover: '', + blog: '', + video: '' + }, { + id: 'pl-keeper', + name: 'Keeper', + description: 'Keeper is the clone of google keep where we can save and delete our notes', + component: () => {return }, + path: '/plays/keeper', + level: 'Intermediate', + tags: 'JSX,Hooks,ReactDOM', + github: 'Shivam-Katare', + cover: 'https://res.cloudinary.com/dbjmy6wdu/image/upload/v1651678725/keepicon_jsn5bh.png', + blog: '', + video: '' + }, { id: "pl-react-todo-app", name: "React Todo App", description: @@ -159,8 +155,7 @@ export const plays = [ "https://res.cloudinary.com/atapas/image/upload/v1650866465/demos/cover_y20bzk.png", blog: "", video: "", - }, - { + }, { id: "pl-expanding-cards", name: "Expanding-Cards", description: @@ -176,8 +171,7 @@ export const plays = [ cover: "", blog: "", video: "", - }, - { + }, { id: "pl-analog-clock", name: "Analog-Clock", description: "A beautiful wall clock", diff --git a/src/plays/index.js b/src/plays/index.js index 051813d34c..1353b6d97b 100644 --- a/src/plays/index.js +++ b/src/plays/index.js @@ -9,7 +9,9 @@ export { default as CounterApp } from 'plays/counter/CounterApp'; export { default as States } from 'plays/states/States'; export { default as SocialCard } from 'plays/social-card/SocialCard'; export { default as RandomMemeGenerator } from 'plays/random-meme-generator/RandomMemeGenerator'; +export { default as Keeper } from 'plays/keeper/Keeper'; export { default as ReactTodoApp } from 'plays/react-todo-app/ReactTodoApp'; export { default as ExpandingCards } from 'plays/expanding-cards/ExpandingCards'; export { default as AnalogClock } from 'plays/analog-clock/AnalogClock'; + //add export here diff --git a/src/plays/keeper/CreateArea.jsx b/src/plays/keeper/CreateArea.jsx new file mode 100644 index 0000000000..e6cd70ed5a --- /dev/null +++ b/src/plays/keeper/CreateArea.jsx @@ -0,0 +1,51 @@ +import React, { useState } from "react"; +import { FaPlusCircle } from 'react-icons/fa'; + +function CreateArea(props) { + const [note, setNote] = useState({ + title: "", + content: "" + }); + function handleChange(event) { + const { name, value } = event.target; + setNote(prevNote => { + return { + ...prevNote, + [name]: value + }; + }); + } + function submitNote(event) { + props.onAdd(note); + setNote({ + title: "", + content: "" + }); + event.preventDefault(); + } + return ( +
+
+ {( + + ) + } +