From 9688f07e4fd156cc3f0b2e05111b02de641b98c3 Mon Sep 17 00:00:00 2001 From: "Siddhesh.More" Date: Thu, 16 Jan 2025 12:10:28 +0530 Subject: [PATCH] UPDATE --- dev-dist/sw.js | 2 +- src/Constants/Constaants.tsx | 30 --- src/Constants/Constants.tsx | 19 ++ src/Layouts/DefaultLayout.tsx | 22 +- src/Pages/ManagePost/ManagePost.tsx | 5 +- .../RegisterUsers/RegisterUsers.tsx | 225 ++++++++++++++++++ src/Routes/Nav.ts | 18 +- src/Routes/Routes.ts | 12 +- src/components/DataTable.tsx | 35 +++ src/index.css | 77 +----- 10 files changed, 319 insertions(+), 126 deletions(-) delete mode 100644 src/Constants/Constaants.tsx create mode 100644 src/Constants/Constants.tsx create mode 100644 src/components/DataTable.tsx diff --git a/dev-dist/sw.js b/dev-dist/sw.js index b003956..c8fe26e 100644 --- a/dev-dist/sw.js +++ b/dev-dist/sw.js @@ -82,7 +82,7 @@ define(['./workbox-54d0af47'], (function (workbox) { 'use strict'; "revision": "3ca0b8505b4bec776b69afdba2768812" }, { "url": "index.html", - "revision": "0.jlpvaemfr1" + "revision": "0.7mpt2f2te58" }], {}); workbox.cleanupOutdatedCaches(); workbox.registerRoute(new workbox.NavigationRoute(workbox.createHandlerBoundToURL("index.html"), { diff --git a/src/Constants/Constaants.tsx b/src/Constants/Constaants.tsx deleted file mode 100644 index 842f931..0000000 --- a/src/Constants/Constaants.tsx +++ /dev/null @@ -1,30 +0,0 @@ -export const getTitle = (loactions:string) =>{ - - if (loactions==='/') { - return 'Dashboard' - }else if (loactions==='/register-user') { - return 'Manage User - Register User' - } else if (loactions==='/deactivate-accounts') { - return 'Manage User - Deactivated User' - } else if (loactions==='/manage-post') { - return 'Manage Post' - } else if (loactions==='/manage-sub-admin') { - return 'Manage Sub Admin' - } else if (loactions==='/manage-jobs') { - return 'Manage Jobs' - } else if (loactions==='/manage-contact-us') { - return 'Manage Contact Us' - } else if (loactions==='/manage-contact-us') { - return 'Manage Contact Us' - }else if (loactions==='/faq') { - return 'Manage CMS - FAQ' - }else if (loactions==='/about-us') { - return 'Manage CMS - About Us' - }else if (loactions==='/privacy-policy') { - return 'Manage CMS - Privacy Policy' - }else if (loactions==='/terms-and-condition') { - return 'Manage CMS - Tems And Condition' - }else if (loactions==='/profile') { - return 'My Profile' - } -} \ No newline at end of file diff --git a/src/Constants/Constants.tsx b/src/Constants/Constants.tsx new file mode 100644 index 0000000..09c8792 --- /dev/null +++ b/src/Constants/Constants.tsx @@ -0,0 +1,19 @@ +export const getTitle = (location: string): string => { + const titles: { [key: string]: string } = { + '/': 'Dashboard', + '/manage-user/register-user': 'Manage User', + '/manage-user/deactivate-accounts': 'Manage User', + '/manage-post': 'Manage Post', + '/manage-sub-admin': 'Manage Sub Admin', + '/manage-jobs': 'Manage Jobs', + '/manage-contact-us': 'Manage Contact Us', + '/manage-cms/faq': 'Manage CMS', + '/manage-cms/about-us': 'Manage CMS', + '/manage-cms/privacy-policy': 'Manage CMS', + '/manage-cms/terms-and-condition': 'Manage CMS', + '/profile': 'My Profile', + }; + + return titles[location] || 'Page Not Found'; + }; + \ No newline at end of file diff --git a/src/Layouts/DefaultLayout.tsx b/src/Layouts/DefaultLayout.tsx index c6df190..cac6cd9 100644 --- a/src/Layouts/DefaultLayout.tsx +++ b/src/Layouts/DefaultLayout.tsx @@ -6,12 +6,14 @@ import { nav } from "../Routes/Nav"; import logo from '../assets/logo.svg'; import { AccordionItem, AccordionItemContent, AccordionItemTrigger, AccordionRoot } from "../components/ui/accordion"; import { Avatar } from "../components/ui/avatar"; -import { getTitle } from "../Constants/Constaants"; +import { getTitle } from "../Constants/Constants"; const DefaultLayout: FC<{ children: React.ReactNode }> = ({ children }) => { const navigate = useNavigate() const location = useLocation() const headerTitle = getTitle(location?.pathname) + console.log(location); + @@ -19,27 +21,27 @@ const DefaultLayout: FC<{ children: React.ReactNode }> = ({ children }) => { return ( - + - - {nav?.map(({ title, path, Icon, type, children }, index) => type === 'single' ? - {title} : + + {nav?.map(({ title, path, Icon, type, children, initPath }, index) => type === 'single' ? + {title} : - - navigate(path)} gap={0} style={{ cursor: 'pointer', borderRadius: '8px', padding: '5px', width: '100%', display: 'flex', alignItems: 'center', border: '1px solid #ffffff', backgroundColor:'#fff',color:'#000', fontSize: '14px', fontWeight:'normal' }}> {title} + + navigate(path)} gap={0} style={{ cursor: 'pointer', borderRadius: '8px', padding: '5px', width: '100%', display: 'flex', alignItems: 'center', border: '1px solid #ffffff', backgroundColor:'#fff',color:'#000', fontSize: '14px', fontWeight:'normal' }}> {title} {children?.map(({ title, path, Icon }, index) => navigate(path)} style={{ marginTop: 6, cursor: 'pointer', borderRadius: '8px', padding: '6px', width: '100%', display: 'flex', alignItems: 'center', gap: 6, border: '1px solid #ffffff', backgroundColor:'#fff',color:'#000' }} > {title})} )} - - {headerTitle} - + + {headerTitle} + navigate('/profile')} > diff --git a/src/Pages/ManagePost/ManagePost.tsx b/src/Pages/ManagePost/ManagePost.tsx index edbb8e2..2dc46be 100644 --- a/src/Pages/ManagePost/ManagePost.tsx +++ b/src/Pages/ManagePost/ManagePost.tsx @@ -1,7 +1,10 @@ +import MainFrame from "../../components/MainFrame" const ManagePost = () => { return ( -
ManagePost
+ + + ) } diff --git a/src/Pages/ManageUser/RegisterUsers/RegisterUsers.tsx b/src/Pages/ManageUser/RegisterUsers/RegisterUsers.tsx index f32f938..312e8d9 100644 --- a/src/Pages/ManageUser/RegisterUsers/RegisterUsers.tsx +++ b/src/Pages/ManageUser/RegisterUsers/RegisterUsers.tsx @@ -1,9 +1,234 @@ +import { Box, HStack, Input, Stack, Table, Text } from '@chakra-ui/react' import MainFrame from '../../../components/MainFrame' +import { InputGroup } from '../../../components/ui/input-group' +import { LuSearch } from 'react-icons/lu' +import DataTable from '../../../components/DataTable' + + + + + // Table setup + const tableHeadRow = [ + "Sr. No", + "First Name", + "Mobile number", + "Gender", + "DOB", + "Type of User", + "Language", + "Status", + "Action", + ]; + + + + const usersData:any[] = [ + { + "Sr. No": 1, + "First Name": "Ritesh", + "Mobile number": "9876543210", + "Gender": "Male", + "DOB": "15-01-1990", + "Type of User": "Admin", + "Language": "English", + "Status": "Active", + "Action": "Edit/Delete", + }, + { + 'Sr. No': 2, + "First Name": "Anjali", + "Mobile number": "9123456789", + "Gender": "Female", + "DOB": "21-06-1995", + "Type of User": "Customer", + "Language": "Hindi", + "Status": "Inactive", + "Action": "Edit/Delete", + }, + { + 'Sr. No': 3, + "First Name": "Rajesh", + "Mobile number": "9871234560", + "Gender": "Male", + "DOB": "12-12-1985", + "Type of User": "Vendor", + "Language": "English", + "Status": "Active", + "Action": "Edit/Delete", + }, + { + 'Sr. No': 4, + "First Name": "Priya", + "Mobile number": "9988776655", + "Gender": "Female", + "DOB": "05-05-1998", + "Type of User": "Customer", + "Language": "Tamil", + "Status": "Active", + "Action": "Edit/Delete", + }, + { + 'Sr. No': 5, + "First Name": "Amit", + "Mobile number": "8899665544", + "Gender": "Male", + "DOB": "03-03-1992", + "Type of User": "Admin", + "Language": "Gujarati", + "Status": "Inactive", + "Action": "Edit/Delete", + }, + { + 'Sr. No': 6, + "First Name": "Amit", + "Mobile number": "8899665544", + "Gender": "Male", + "DOB": "03-03-1992", + "Type of User": "Admin", + "Language": "Gujarati", + "Status": "Inactive", + "Action": "Edit/Delete", + }, + { + 'Sr. No': 7, + "First Name": "Amit", + "Mobile number": "8899665544", + "Gender": "Male", + "DOB": "03-03-1992", + "Type of User": "Admin", + "Language": "Gujarati", + "Status": "Inactive", + "Action": "Edit/Delete", + }, + { + 'Sr. No': 5, + "First Name": "Amit", + "Mobile number": "8899665544", + "Gender": "Male", + "DOB": "03-03-1992", + "Type of User": "Admin", + "Language": "Gujarati", + "Status": "Inactive", + "Action": "Edit/Delete", + }, + { + 'Sr. No': 6, + "First Name": "Amit", + "Mobile number": "8899665544", + "Gender": "Male", + "DOB": "03-03-1992", + "Type of User": "Admin", + "Language": "Gujarati", + "Status": "Inactive", + "Action": "Edit/Delete", + }, + { + 'Sr. No': 7, + "First Name": "Amit", + "Mobile number": "8899665544", + "Gender": "Male", + "DOB": "03-03-1992", + "Type of User": "Admin", + "Language": "Gujarati", + "Status": "Inactive", + "Action": "Edit/Delete", + }, + { + 'Sr. No': 8, + "First Name": "Amit", + "Mobile number": "8899665544", + "Gender": "Male", + "DOB": "03-03-1992", + "Type of User": "Admin", + "Language": "Gujarati", + "Status": "Inactive", + "Action": "Edit/Delete", + }, + { + 'Sr. No': 9, + "First Name": "Amit", + "Mobile number": "8899665544", + "Gender": "Male", + "DOB": "03-03-1992", + "Type of User": "Admin", + "Language": "Gujarati", + "Status": "Inactive", + "Action": "Edit/Delete", + }, + { + 'Sr. No': 10, + "First Name": "Amit", + "Mobile number": "8899665544", + "Gender": "Male", + "DOB": "03-03-1992", + "Type of User": "Admin", + "Language": "Gujarati", + "Status": "Inactive", + "Action": "Edit/Delete", + }, + { + 'Sr. No': 11, + "First Name": "Amit", + "Mobile number": "8899665544", + "Gender": "Male", + "DOB": "03-03-1992", + "Type of User": "Admin", + "Language": "Gujarati", + "Status": "Inactive", + "Action": "Edit/Delete", + }, + { + 'Sr. No': 12, + "First Name": "Amit", + "Mobile number": "8899665544", + "Gender": "Male", + "DOB": "03-03-1992", + "Type of User": "Admin", + "Language": "Gujarati", + "Status": "Inactive", + "Action": "Edit/Delete", + }, + { + 'Sr. No': 13, + "First Name": "Amit", + "Mobile number": "8899665544", + "Gender": "Male", + "DOB": "03-03-1992", + "Type of User": "Admin", + "Language": "Gujarati", + "Status": "Inactive", + "Action": "Edit/Delete", + }, + ]; + const RegisterUsers = () => { + return ( + + Register User + + + + } + w={'100%'} + color={'#000'} + > + + + + + + + + + + ) } diff --git a/src/Routes/Nav.ts b/src/Routes/Nav.ts index c0450b5..5c3852d 100644 --- a/src/Routes/Nav.ts +++ b/src/Routes/Nav.ts @@ -17,18 +17,19 @@ export const nav = [ }, { title: "Manage Users", - path: "/register-user", + path: "/manage-user/register-user", + initPath:'/manage-user', Icon: TiUserOutline, type:'multiple', children: [ { title: "Register Users", - path: "/register-user", + path: "/manage-user/register-user", Icon: GoDotFill, }, { title: "Deactivated Accounts", - path: "/deactivate-accounts", + path: "/manage-user/deactivate-accounts", Icon: GoDotFill, }, ], @@ -60,28 +61,29 @@ export const nav = [ { title: "Manage CMS", - path: "/faq", + initPath:'/manage-cms', + path: "/manage-cms/faq", Icon: TiDocumentText, type:'multiple', children: [ { title: "FAQ", - path: "/faq", + path: "/manage-cms/faq", Icon: GoDotFill, }, { title: "About Us", - path: "/about-us", + path: "/manage-cms/about-us", Icon: GoDotFill, }, { title: "Privacy Policy", - path: "/privacy-policy", + path: "/manage-cms/privacy-policy", Icon: GoDotFill, }, { title: "Terms And Conditions", - path: "/terms-and-condition", + path: "/manage-cms/terms-and-condition", Icon: GoDotFill, }, ], diff --git a/src/Routes/Routes.ts b/src/Routes/Routes.ts index a9ee324..6157151 100644 --- a/src/Routes/Routes.ts +++ b/src/Routes/Routes.ts @@ -12,24 +12,24 @@ import RegisterUsers from "../Pages/ManageUser/RegisterUsers/RegisterUsers"; import Profile from "../Pages/Profile/Profile"; export const RouteLink = [ { path: "/", Component: Dashboard }, - { path: "/register-user", Component: RegisterUsers }, - { path: "/deactivate-accounts", Component: DeactivatedAccounts }, + { path: "/manage-user/register-user", Component: RegisterUsers }, + { path: "/manage-user/deactivate-accounts", Component: DeactivatedAccounts }, { path: "/manage-post", Component: ManagePost }, { path: "/manage-sub-admin", Component: ManageSubAdmin }, { path: "/manage-jobs", Component: ManageJobs }, { path: "/manage-contact-us", Component: ManageContactUs }, - { path: "/faq", Component: FreqAskQuestion }, + { path: "/manage-cms/faq", Component: FreqAskQuestion }, - { path: "/about-us", Component: AboutUs }, + { path: "/manage-cms/about-us", Component: AboutUs }, - { path: "/privacy-policy", Component: PrivacyPolicy }, + { path: "/manage-cms/privacy-policy", Component: PrivacyPolicy }, - { path: "/terms-and-condition", Component: PrivacyPolicy }, + { path: "/manage-cms/terms-and-condition", Component: PrivacyPolicy }, diff --git a/src/components/DataTable.tsx b/src/components/DataTable.tsx new file mode 100644 index 0000000..cb5cbbe --- /dev/null +++ b/src/components/DataTable.tsx @@ -0,0 +1,35 @@ +import { Stack, Table } from "@chakra-ui/react" + + +interface TableProps { + tableHeadRow: string[]; + data: Record[]; +} + + + +const DataTable: React.FC = ({ tableHeadRow, data }) => { + return ( + + + + + {tableHeadRow.map((item, index)=>{item})} + + + + + {data.map((item:any, index) => ( + + {tableHeadRow.map((heading)=>{item[heading]} )} + + ))} + + + + + ) +} + +export default DataTable \ No newline at end of file diff --git a/src/index.css b/src/index.css index 1ac4b6c..7e69aee 100644 --- a/src/index.css +++ b/src/index.css @@ -1,4 +1,4 @@ -*{ +body{ margin: 0; padding: 0; box-sizing: border-box; @@ -21,7 +21,12 @@ /* background-color: #e2e8f01c !important; */ } - +.active>.css-1ic543h { + -webkit-transition: rotate 0.2s; + transition: rotate 0.2s; + transform-origin: center; + color: #fff; +} .linkChild:hover{ color: #02A0A0 !important; @@ -48,71 +53,3 @@ /* background-color: #e2e8f01c !important; */ } - -/* Sphere.css */ - -/* ✅ Red Spheres */ -.red-sphere-1, -.red-sphere-2, -.red-sphere-3{ - position: absolute; - border-radius: 50%; - background-color: #D90B2E46; - box-shadow: 0 4px 30px rgba(0, 0, 0, 0.1); - filter: blur(100px); -} - -/* ✅ Blue Spheres */ -.blue-sphere-1, -.blue-sphere-2, -.blue-sphere-3{ - position: absolute; - border-radius: 50%; - background-color: #009DAB46; - box-shadow: 0 4px 30px rgba(0, 0, 0, 0.1); - filter: blur(100px); -} - -/* 🔧 Positioning for Spheres */ -.red-sphere-1 { - width: 250px; - height: 250px; - top: 10%; - left: 5%; -} - -.blue-sphere-1 { - width: 320px; - height: 320px; - top: 30%; - right: 0%; -} - -.red-sphere-2 { - width: 180px; - height: 180px; - bottom: 15%; - left: 20%; -} - -.blue-sphere-2 { - width: 140px; - height: 140px; - bottom: 5%; - right: 25%; -} - -.red-sphere-3 { - width: 480px; - height: 480px; - bottom: 55%; - left: 40%; -} - -.blue-sphere-3{ - width: 300px; - height: 300px; - bottom: 10%; - right: 40%; -} -