From 29f1a5285f757ce6b34782100d1e85e5dcf9609c Mon Sep 17 00:00:00 2001 From: Rushikesh Tarapure Date: Tue, 29 Mar 2022 17:05:43 +0530 Subject: [PATCH] created single export file --- src/Layout/Header/Header.jsx | 3 +-- src/Layout/index.js | 2 ++ src/Layout/sidebar/Sidebar.jsx | 3 +-- src/components/CreateNote/CreateNote.jsx | 4 ++-- src/components/CreateNote/create-note.css | 1 + src/components/Note/Note.jsx | 7 ++++--- src/components/index.js | 2 ++ src/pages/Notes/NotesPage.jsx | 6 ++---- 8 files changed, 15 insertions(+), 13 deletions(-) create mode 100644 src/Layout/index.js create mode 100644 src/components/index.js diff --git a/src/Layout/Header/Header.jsx b/src/Layout/Header/Header.jsx index 41663b2..7e82b1f 100644 --- a/src/Layout/Header/Header.jsx +++ b/src/Layout/Header/Header.jsx @@ -3,7 +3,7 @@ import "./note-header.css"; import { AiOutlineSearch, AiOutlineMenu } from "react-icons/ai"; import { MdDarkMode, MdLogout } from "react-icons/md"; -const Header = ({ toggle }) => { +export const Header = ({ toggle }) => { return (
@@ -25,4 +25,3 @@ const Header = ({ toggle }) => { ); }; -export default Header; diff --git a/src/Layout/index.js b/src/Layout/index.js new file mode 100644 index 0000000..9f15e51 --- /dev/null +++ b/src/Layout/index.js @@ -0,0 +1,2 @@ +export {Sidebar} from './sidebar/Sidebar' +export {Header} from './Header/Header' \ No newline at end of file diff --git a/src/Layout/sidebar/Sidebar.jsx b/src/Layout/sidebar/Sidebar.jsx index 37c973b..3814bc0 100644 --- a/src/Layout/sidebar/Sidebar.jsx +++ b/src/Layout/sidebar/Sidebar.jsx @@ -3,7 +3,7 @@ import "./sidebar.css"; import { useNavigate } from "react-router-dom"; import sidebarData from "../../data/sidebarData"; -const Sidebar = ({ sidebar }) => { +export const Sidebar = ({ sidebar }) => { const navigator = useNavigate(); return ( @@ -25,4 +25,3 @@ const Sidebar = ({ sidebar }) => { ); }; -export default Sidebar; diff --git a/src/components/CreateNote/CreateNote.jsx b/src/components/CreateNote/CreateNote.jsx index 99f0948..a1c07c1 100644 --- a/src/components/CreateNote/CreateNote.jsx +++ b/src/components/CreateNote/CreateNote.jsx @@ -3,7 +3,7 @@ import "./create-note.css"; import Editor from "../Editor/Editor"; import { MdOutlineColorLens } from "react-icons/md"; -const CreateNote = () => { +export const CreateNote = () => { const [expand, setExpand] = useState(false); const closer = () => { setExpand(false); @@ -41,4 +41,4 @@ const CreateNote = () => { ); }; -export default CreateNote; + diff --git a/src/components/CreateNote/create-note.css b/src/components/CreateNote/create-note.css index e0f7ceb..cdf4ed1 100644 --- a/src/components/CreateNote/create-note.css +++ b/src/components/CreateNote/create-note.css @@ -26,6 +26,7 @@ border-radius: 5px; outline: none; border: none; + padding:5px; } .note-title { diff --git a/src/components/Note/Note.jsx b/src/components/Note/Note.jsx index 38d27b8..4cb537b 100644 --- a/src/components/Note/Note.jsx +++ b/src/components/Note/Note.jsx @@ -1,7 +1,8 @@ import React from "react"; -const Note = () => { - return
Note
; +export const Note = () => { + return
+ Note +
; }; -export default Note; diff --git a/src/components/index.js b/src/components/index.js new file mode 100644 index 0000000..5458731 --- /dev/null +++ b/src/components/index.js @@ -0,0 +1,2 @@ +export {CreateNote} from "./CreateNote/CreateNote" +export {Note} from "./Note/Note" \ No newline at end of file diff --git a/src/pages/Notes/NotesPage.jsx b/src/pages/Notes/NotesPage.jsx index 5f6783c..bfaae72 100644 --- a/src/pages/Notes/NotesPage.jsx +++ b/src/pages/Notes/NotesPage.jsx @@ -1,8 +1,6 @@ import React, { useState } from "react"; -import Sidebar from "../../Layout/sidebar/Sidebar"; -import Header from "../../Layout/Header/Header"; -import CreateNote from "../../components/CreateNote/CreateNote"; -import Note from "../../components/Note/Note"; +import {Sidebar,Header} from "../../Layout/index.js"; +import {CreateNote,Note} from "../../components/index.js" import "./notes.css" export const NotesPage = () => {