├── public
├── robots.txt
├── favicon.ico
├── logo192.png
├── logo512.png
├── manifest.json
└── index.html
├── README.md
├── tailwind.config.js
├── src
├── index.css
├── index.js
├── components
│ ├── Footer.jsx
│ ├── Header.jsx
│ ├── Note.jsx
│ └── InputBox.jsx
└── App.js
├── .gitignore
└── package.json
/public/robots.txt:
--------------------------------------------------------------------------------
1 | # https://www.robotstxt.org/robotstxt.html
2 | User-agent: *
3 | Disallow:
4 |
--------------------------------------------------------------------------------
/public/favicon.ico:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/vishnubansal001/Keeper-App-reactjs-tailwindcss/HEAD/public/favicon.ico
--------------------------------------------------------------------------------
/public/logo192.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/vishnubansal001/Keeper-App-reactjs-tailwindcss/HEAD/public/logo192.png
--------------------------------------------------------------------------------
/public/logo512.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/vishnubansal001/Keeper-App-reactjs-tailwindcss/HEAD/public/logo512.png
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | # Keeper App
2 |
3 |
4 | Hey there, I am presenting a keeper app built using the famous framework i.e., React js.
5 |
6 |
7 |
--------------------------------------------------------------------------------
/tailwind.config.js:
--------------------------------------------------------------------------------
1 | /** @type {import('tailwindcss').Config} */
2 | module.exports = {
3 | content: ["./src/**/*.{js,jsx,ts,tsx}"],
4 | theme: {
5 | extend: {},
6 | },
7 | plugins: [],
8 | }
9 |
--------------------------------------------------------------------------------
/src/index.css:
--------------------------------------------------------------------------------
1 | @tailwind base;
2 | @tailwind components;
3 | @tailwind utilities;
4 | *{
5 | margin: 0;
6 | padding: 0;
7 | box-sizing: border-box;
8 | }
9 | body{
10 | background-color: #eee;
11 | }
--------------------------------------------------------------------------------
/src/index.js:
--------------------------------------------------------------------------------
1 | import React from 'react';
2 | import ReactDOM from 'react-dom/client';
3 | import './index.css';
4 | import App from './App';
5 |
6 | const root = ReactDOM.createRoot(document.getElementById('root'));
7 | root.render(
8 |
9 |
10 |
11 | );
--------------------------------------------------------------------------------
/src/components/Footer.jsx:
--------------------------------------------------------------------------------
1 | import React from 'react'
2 |
3 | export default function Footer() {
4 | const year = new Date();
5 | return (
6 |
9 | )
10 | }
11 |
--------------------------------------------------------------------------------
/src/components/Header.jsx:
--------------------------------------------------------------------------------
1 | import React from 'react'
2 |
3 | export default function Header() {
4 | return (
5 |
8 | )
9 | }
10 |
--------------------------------------------------------------------------------
/.gitignore:
--------------------------------------------------------------------------------
1 | # See https://help.github.com/articles/ignoring-files/ for more about ignoring files.
2 |
3 | # dependencies
4 | /node_modules
5 | /.pnp
6 | .pnp.js
7 |
8 | # testing
9 | /coverage
10 |
11 | # production
12 | /build
13 |
14 | # misc
15 | .DS_Store
16 | .env.local
17 | .env.development.local
18 | .env.test.local
19 | .env.production.local
20 |
21 | npm-debug.log*
22 | yarn-debug.log*
23 | yarn-error.log*
24 |
--------------------------------------------------------------------------------
/public/manifest.json:
--------------------------------------------------------------------------------
1 | {
2 | "short_name": "React App",
3 | "name": "Create React App Sample",
4 | "icons": [
5 | {
6 | "src": "favicon.ico",
7 | "sizes": "64x64 32x32 24x24 16x16",
8 | "type": "image/x-icon"
9 | },
10 | {
11 | "src": "logo192.png",
12 | "type": "image/png",
13 | "sizes": "192x192"
14 | },
15 | {
16 | "src": "logo512.png",
17 | "type": "image/png",
18 | "sizes": "512x512"
19 | }
20 | ],
21 | "start_url": ".",
22 | "display": "standalone",
23 | "theme_color": "#000000",
24 | "background_color": "#ffffff"
25 | }
26 |
--------------------------------------------------------------------------------
/src/components/Note.jsx:
--------------------------------------------------------------------------------
1 | import React from 'react'
2 |
3 | export default function Note(props) {
4 | function handleClick(){
5 | props.onDelete(props.id);
6 | }
7 | return (
8 |
9 |
{props.title}
10 |
{props.content}
11 |
12 |
13 | )
14 | }
15 |
--------------------------------------------------------------------------------
/public/index.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
12 |
13 |
14 | Keeper App
15 |
16 |
17 |
18 |
19 |
20 |
21 |
--------------------------------------------------------------------------------
/src/App.js:
--------------------------------------------------------------------------------
1 | import { useState } from "react";
2 | import Footer from "./components/Footer";
3 | import Header from "./components/Header";
4 | import InputBox from "./components/InputBox";
5 | import Note from "./components/Note";
6 |
7 | function App() {
8 | const [notes,setNotes] = useState([]);
9 | function addNote(newNote){
10 | setNotes(prevNotes => {
11 | return [...prevNotes,newNote];
12 | });
13 | }
14 | function deleteNote(id){
15 | setNotes(prevNotes => {
16 | return prevNotes.filter((noteItem,index) => {
17 | return index!== id;
18 | })
19 | })
20 | }
21 | return (
22 |
23 | {/*
hsdfb
*/}
24 |
25 |
26 | {
27 | notes.map((nateItem,index) => {
28 | return ()
29 | })
30 | }
31 |
32 |
33 | );
34 | }
35 |
36 | export default App;
37 |
--------------------------------------------------------------------------------
/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "practice",
3 | "version": "0.1.0",
4 | "private": true,
5 | "dependencies": {
6 | "@testing-library/jest-dom": "^5.16.5",
7 | "@testing-library/react": "^13.4.0",
8 | "@testing-library/user-event": "^13.5.0",
9 | "react": "^18.2.0",
10 | "react-dom": "^18.2.0",
11 | "react-icons": "^4.7.1",
12 | "react-router-dom": "^6.8.1",
13 | "react-scripts": "5.0.1",
14 | "uuid": "^9.0.0",
15 | "web-vitals": "^2.1.4"
16 | },
17 | "scripts": {
18 | "start": "react-scripts start",
19 | "build": "react-scripts build",
20 | "test": "react-scripts test",
21 | "eject": "react-scripts eject"
22 | },
23 | "eslintConfig": {
24 | "extends": [
25 | "react-app",
26 | "react-app/jest"
27 | ]
28 | },
29 | "browserslist": {
30 | "production": [
31 | ">0.2%",
32 | "not dead",
33 | "not op_mini all"
34 | ],
35 | "development": [
36 | "last 1 chrome version",
37 | "last 1 firefox version",
38 | "last 1 safari version"
39 | ]
40 | },
41 | "devDependencies": {
42 | "tailwindcss": "^3.2.6"
43 | }
44 | }
45 |
--------------------------------------------------------------------------------
/src/components/InputBox.jsx:
--------------------------------------------------------------------------------
1 | import React, { useState } from 'react'
2 |
3 | export default function InputBox(props) {
4 | const [note,setNote] = useState({
5 | title:"",
6 | content:""
7 | });
8 | function handleChange(event){
9 | const {name,value} = event.target;
10 | setNote(prevNote => {
11 | return {
12 | ...prevNote,
13 | [name]:value
14 | };
15 | });
16 | }
17 | function submitNote(event){
18 | props.onAdd(note);
19 | setNote({
20 | title:"",
21 | content:""
22 | });
23 | event.preventDefault();
24 | }
25 |
26 | return (
27 |
28 |
33 |
34 | )
35 | }
36 |
--------------------------------------------------------------------------------