Complete Note app in ReactJs using boostrap

 Complete Note app in ReactJs using boostrap


Using Files: (index.js, index.css, App.js, CreateNote.js, Note.js)

Source code:-

index.js

import React from "react";
import ReactDom from "react-dom";
import App from './App'
import "./index.css";

ReactDom.render(
  <>
    <App />
  </>,
  document.getElementById("root")

)

index.css

*{
    box-sizingborder-box;
    padding0;
    margin0;
    font-family'Patrick Hand', cursive;
    /* font-weight: 900; */

}

.header{
    width100%;
    line-height100px;
    background-color#f5ba13;
    displayflex;
    justify-contentcenter;
    align-itemscenter;
    padding-left50px;
    colorwhite;
    box-shadow5px 3px 15px -5px rgba(000);
}

.main_note{
    width500px;
    padding15px 10px 5px 10px;
    margin20px auto;
    box-shadow3px 5px 15px -5px rgba(400);
    border-radius10px;
}
.main_note Button{
    box-shadow0px 0px 20px -4px rgb(4 0 0);
    height62px;

}
.my_notes h1{
    color#34495e;
}
.my_notes p {
    colorgrey;
}

form{
    min-height50px;
    color#ecf0f1;
    padding0px 10px -3px 10px;
    box-shadow3px 5px 15px -5px rgba(4000);
    border-radius:10px;
    positionrelative;
}

input {
    width100%;
    line-height30px;
    backgroundtransparent;
    bordernone;
    outlinenone;
    font-size1.5rem;
    margin10px 0;
    font-weightbold;
}

textarea {
    width100%;
    line-height30px;
    backgroundtransparent;
    bordernone;
    outlinenone;
    font-size1rem;
    margin10px 0;
}

.MuiButton-root {
    width30px;
    height50px;
    positionabsolute;
    bottom-28px;
    left400px;
    cursorpointer;
    background-color#fff !important;
    box-shadow5pc 5px 15px -5pc rgba(0000);
    border-radius50% !important;
}

.MuiButton-root .plus_sign {
    font-size45px !important;
    font-weight900;
    color#f4b400;
    cursorpointer;
    z-index222;
    backgroundtransparent;
}

.MuiButton-root:hover {
    background#f4b400 !important;
}
.MuiButton-root:hover .plus_sign {
    color#fff;
    backgroundtransparent;
}
.note {
    background#fff;
    border-radius7px;
    box-shadow0px 2px 10px -3px rgba(400);
    padding0px;
    width240px;
    margin16px;
    floatleft;
}

.note h1 {
    width100%;
    line-height30px;
    backgroundtransparent;
    bordernone;
    outlinenone;
    font-size1.5rem;
    margin10px 9px;
    font-weightbold;
}
.note p {
    font-size1.1em;
    margin-bottom0px;
    margin-left12px;
    white-spacepre-wrap;
    word-wrapbreak-word;
}
.note .btn {
    positionrelative;
    floatright;
    margin-right:10px;
    color#f7b900;
    bordernone;
    width50px;
    height50px;
    backgroundtransparent;
    cursorpointer;
    outlinenone;
    box-shadow0px 5px 15px -5px rgba(400);
    border-radius50%;
}
.deleteIcon{
    width0.7em;
    height0.7em;
    cursorpointer;
}
.note .btn:hover .deleteIcon{
    colorrgb(2552040);
}
.note .btn:hover{
    background-color#000000;
}

footer{
    width100%;
    positionabsolute;
    bottom0;
    text-aligncenter;
}

App.js


import React, { useState } from "react";
import Header from "./components/Header";
// import Footer from "./components/Footer";
// import "./index.css";
import CreateNote from "./components/CreateNote";
import Note from "./components/Note";



const App = () => {
  const [addItemsetAddItem]=useState([]);
  const addNote = (note)=>{
    // alert('i am clicked');
    setAddItem((prevData)=>{
      return[...prevDatanote];      
    });
  }

  return (
    <>
      <div>
        <Header />
        
        <CreateNote 
          passNote = {addNote}
        />
        
          {addItem.map((valindex)=>{
            return <Note
            key{index}
            id={index}
            title={val.title}
            content = {val.content}/>
          })}
        
        {/* <Footer /> */}
      </div>
    </>
  );
};

export default App;

CreateNode.js

import React, { useState } from 'react'
import AddIcon from '@material-ui/icons/Add';
import Button from '@material-ui/core/Button';

export default function CreateNote(props) {

    const [notesetNote] = useState({
        title'',
        content''
    });

    const inputEvent = (event=> {
        const { namevalue } = event.target;
        setNote((prevData=> {
            return {
                ...prevData,
                [name]: value
            }
        })
    }

    const btnClick = () => {    
        props.passNote(note);
        setNote({
            title'',
            content''
        })
    }

    return (
        <div className="main_note">
            <form>
                <input type="text" value={note.title} name="title" onChange={inputEvent} placeholder="Title" autoComplete="off" />
                <textarea value={note.content} name="content" onChange={inputEvent} id="" cols="" rows="" placeholder="Write a note.."></textarea>
                <Button onClick={btnClick}>
                    <AddIcon />
                </Button>
            </form>
        </div>
    )
}

Note.js

import React from 'react'
import DeleteIcon from '@material-ui/icons/Delete';

export default function Note(props) {
    return (
        <div className='note'>
            <h1>{props.title}</h1>
            <br />
            <p>{props.content}</p>
            <button className="btn">
            <DeleteIcon className='deleteIcon'/></button>
        </div>
    )
}