diff --git a/src/App.js b/src/App.js index bf0e08a..eeae0b8 100644 --- a/src/App.js +++ b/src/App.js @@ -14,6 +14,7 @@ import ViewFormPage from "./pages/ViewForm/ViewFormPage"; import { AuthProvider } from "./components/context/Auth"; import VillagesList from "./pages/VillagesList/VillagesList"; import RouteAuth from "./components/context/RouteAuth"; +import VillageOverview from "./pages/Dashboard/VillageOverview/VillageOverview"; export default function App() { return ( @@ -45,6 +46,11 @@ export default function App() { }> } /> + } + > + } /> + ) : null} } /> diff --git a/src/assets/images/dashboardLogo.png b/src/assets/images/dashboardLogo.png new file mode 100644 index 0000000..703c384 Binary files /dev/null and b/src/assets/images/dashboardLogo.png differ diff --git a/src/components/Dashboard/DashboardDropdown/DashboardDropdown.css b/src/components/Dashboard/DashboardDropdown/DashboardDropdown.css new file mode 100644 index 0000000..42b57eb --- /dev/null +++ b/src/components/Dashboard/DashboardDropdown/DashboardDropdown.css @@ -0,0 +1,49 @@ +.dropdown { + position: relative; +} +.dropdownBtn { + padding: 0.5rem; + display: flex; + align-items: center; + justify-content: space-around; + background-color: #e3e6f9; + border: none; + border-radius: 0.5rem; + width: 200px; +} +.dropdownBtn h6 { + margin-top: 0.4rem; +} +.menu { + position: absolute; + list-style-type: none; + margin: 5px 0; + padding: 0; + border-radius: 1rem; + overflow: hidden; + border-radius: 1rem; + width: 180px; +} + +.menu > li { + margin: 0; + background-color: #e3e6f9; +} + +.menu > li:hover { + background-color: #956ef8; + color: #ffff; +} + +.menu > li > button { + width: 100%; + height: 100%; + text-align: center; + background: none; + color: inherit; + border: none; + padding: 5px; + margin: 0; + font: inherit; + cursor: pointer; +} diff --git a/src/components/Dashboard/DashboardDropdown/DashboardDropdown.jsx b/src/components/Dashboard/DashboardDropdown/DashboardDropdown.jsx new file mode 100644 index 0000000..1563ac2 --- /dev/null +++ b/src/components/Dashboard/DashboardDropdown/DashboardDropdown.jsx @@ -0,0 +1,44 @@ +import React, { useState } from "react"; +import "./DashboardDropdown.css"; +import { BsFillCaretDownFill } from "react-icons/bs"; +const villages = [ + "Lasudiya Khas", + "Gawa Kheda", + "Beda Khedi", + "Mana Khedi", + "Nipaniya Kalan", +]; +const DashboardDropdown = () => { + const [open, setOpen] = useState(false); + const [selectedVillage, setSelectedVillage] = useState("Select Village"); + const handleOpen = () => { + setOpen(!open); + }; + + const handleMenu = (village) => { + setSelectedVillage(village); + setOpen(false); + }; + + return ( +
+ + {open ? ( +
    + {villages.map((village, index) => { + return ( +
  • + +
  • + ); + })} +
+ ) : null} +
+ ); +}; + +export default DashboardDropdown; diff --git a/src/components/Dashboard/Sidebar/Sidebar.css b/src/components/Dashboard/Sidebar/Sidebar.css new file mode 100644 index 0000000..ad2407d --- /dev/null +++ b/src/components/Dashboard/Sidebar/Sidebar.css @@ -0,0 +1,48 @@ +@import url("https://fonts.googleapis.com/css2?family=Roboto&display=swap"); +.sidebar { + display: flex; + flex-direction: column; + gap: 30px; + padding-left: 1rem; + height: 100vh; + width: 250px; + background-color: #ffff; + border-top-right-radius: 1rem; + border-bottom-right-radius: 1rem; +} +.sidebarLogo { + margin-top: 1rem; + margin-left: 1rem; +} +.sidebarLogo img { + width: 150px; + border-bottom: 2px solid #58585e; + padding: 1rem; +} +.sidebarMenus .sidebarMenusList { + font-size: 15px; + font-family: "Roboto", sans-serif; + font-style: regular; + line-height: 29px; + color: #9d9cba; + transition: all 0.2s ease-in-out; + cursor: pointer; +} +.listActive{ + font-size: 16px; + font-family: "Roboto", sans-serif; + font-style: regular; + line-height: 29px; + color: #692dfb; + transition: all 0.2s ease-in-out; + cursor: pointer; +} +.sidebarMenus .sidebarMenusList:hover { + color: #692dfb; +} +.sidebarMenus ul { + margin-top: 1rem; + display: flex; + flex-direction: column; + gap: 40px; +} diff --git a/src/components/Dashboard/Sidebar/Sidebar.jsx b/src/components/Dashboard/Sidebar/Sidebar.jsx new file mode 100644 index 0000000..dcad031 --- /dev/null +++ b/src/components/Dashboard/Sidebar/Sidebar.jsx @@ -0,0 +1,43 @@ +import React, { useState } from "react"; +import "./Sidebar.css"; +const Sidebar = () => { + const data = [ + "Village Overview", + "General Household Info", + "Family Members Info", + "Government Schemes", + "Basic Amenities", + "Land and Agriculture", + "Other", + ]; + const [element, setElement] = useState("Village Overview"); + return ( +
+
+ + logo + +
+
+
    + {data.map((elem, index) => { + return ( +
  • setElement(elem)} + key={index} + > + {elem} +
  • + ); + })} +
+
+
+ ); +}; + +export default Sidebar; diff --git a/src/components/Dropdown/DropdownMenuItems.js b/src/components/Dropdown/DropdownMenuItems.js index 4e4caeb..e1b937f 100644 --- a/src/components/Dropdown/DropdownMenuItems.js +++ b/src/components/Dropdown/DropdownMenuItems.js @@ -10,6 +10,11 @@ const DropdownMenuItems = { title: "Villages List", path: "/villages", }, + { + id: 3, + title: "Dashboard", + path: "/dashboard", + } ], user: [ { @@ -39,6 +44,11 @@ const DropdownMenuItems = { title: "Fill the form", path: "/form", }, + { + id: 5, + title: "Dashboard", + path: "/dashboard", + } ], }; diff --git a/src/pages/Dashboard/VillageOverview/VillageOverview.css b/src/pages/Dashboard/VillageOverview/VillageOverview.css new file mode 100644 index 0000000..f3743e9 --- /dev/null +++ b/src/pages/Dashboard/VillageOverview/VillageOverview.css @@ -0,0 +1,20 @@ +@import url("https://fonts.googleapis.com/css2?family=Roboto&display=swap"); +.villageOverviewContainer{ + width: 100vw; + height: 100vh; + display: flex; + background-color: #F0F2F9; +} +.sidebarRightSide{ + width: 90%; +} +.sidebarRightSideTop{ + width: 90%; + margin: 1rem 3rem; + display: flex; + align-items: center; + justify-content: space-between; +} +.dashboardTitle h2{ + font-family: "Roboto", sans-serif; +} \ No newline at end of file diff --git a/src/pages/Dashboard/VillageOverview/VillageOverview.jsx b/src/pages/Dashboard/VillageOverview/VillageOverview.jsx new file mode 100644 index 0000000..75ea9f7 --- /dev/null +++ b/src/pages/Dashboard/VillageOverview/VillageOverview.jsx @@ -0,0 +1,21 @@ +import React from 'react' +import './VillageOverview.css' +import Sidebar from '../../../components/Dashboard/Sidebar/Sidebar' +import DashboardDropdown from '../../../components/Dashboard/DashboardDropdown/DashboardDropdown' +const VilageOverview = () => { + return ( +
+ +
+
+
+

Dashboard - Village Overview

+
+ +
+
+
+ ) +} + +export default VilageOverview \ No newline at end of file