diff --git a/src/Contexts/GlobalStateProvider.jsx b/src/Contexts/GlobalStateProvider.jsx index b01aad1..96db934 100644 --- a/src/Contexts/GlobalStateProvider.jsx +++ b/src/Contexts/GlobalStateProvider.jsx @@ -25,7 +25,7 @@ const GlobalStateProvider = ({ children }) => { { id: 1, sponserName: "John Doe", - sponserNameArabic:"الرجاء إدخال القيمة", + sponserNameArabic: "الرجاء إدخال القيمة", mobileNo: "1234567890", sponserAddress: "123 Main St, Springfield, USA", accountHolderName: "John Doe", @@ -46,7 +46,7 @@ const GlobalStateProvider = ({ children }) => { { id: 2, sponserName: "Jane Smith", - sponserNameArabic:"الرجاء إدخال القيمة", + sponserNameArabic: "الرجاء إدخال القيمة", mobileNo: "9876543210", sponserAddress: "456 Oak St, Metropolis, USA", accountHolderName: "Jane Smith", @@ -67,7 +67,7 @@ const GlobalStateProvider = ({ children }) => { { id: 3, sponserName: "Alice Johnson", - sponserNameArabic:"الرجاء إدخال القيمة", + sponserNameArabic: "الرجاء إدخال القيمة", mobileNo: "1231231234", sponserAddress: "789 Pine St, Gotham, USA", accountHolderName: "Alice Johnson", @@ -88,7 +88,7 @@ const GlobalStateProvider = ({ children }) => { { id: 4, sponserName: "Bob Brown", - sponserNameArabic:"الرجاء إدخال القيمة", + sponserNameArabic: "الرجاء إدخال القيمة", mobileNo: "3213214321", sponserAddress: "101 Maple St, Smallville, USA", accountHolderName: "Bob Brown", @@ -109,7 +109,7 @@ const GlobalStateProvider = ({ children }) => { { id: 5, sponserName: "Charlie Davis", - sponserNameArabic:"الرجاء إدخال القيمة", + sponserNameArabic: "الرجاء إدخال القيمة", mobileNo: "5555555555", sponserAddress: "202 Birch St, Star City, USA", accountHolderName: "Charlie Davis", @@ -130,7 +130,7 @@ const GlobalStateProvider = ({ children }) => { { id: 6, sponserName: "Daniel Evans", - sponserNameArabic:"الرجاء إدخال القيمة", + sponserNameArabic: "الرجاء إدخال القيمة", mobileNo: "4444444444", sponserAddress: "303 Cedar St, Central City, USA", accountHolderName: "Daniel Evans", @@ -151,7 +151,7 @@ const GlobalStateProvider = ({ children }) => { { id: 7, sponserName: "Ella Fitzgerald", - sponserNameArabic:"الرجاء إدخال القيمة", + sponserNameArabic: "الرجاء إدخال القيمة", mobileNo: "3333333333", sponserAddress: "404 Elm St, Coast City, USA", accountHolderName: "Ella Fitzgerald", @@ -172,7 +172,7 @@ const GlobalStateProvider = ({ children }) => { { id: 8, sponserName: "Frank Green", - sponserNameArabic:"الرجاء إدخال القيمة", + sponserNameArabic: "الرجاء إدخال القيمة", mobileNo: "2222222222", sponserAddress: "505 Ash St, Keystone City, USA", accountHolderName: "Frank Green", @@ -193,7 +193,7 @@ const GlobalStateProvider = ({ children }) => { { id: 9, sponserName: "Grace Hall", - sponserNameArabic:"الرجاء إدخال القيمة", + sponserNameArabic: "الرجاء إدخال القيمة", mobileNo: "1111111111", sponserAddress: "606 Willow St, Hub City, USA", accountHolderName: "Grace Hall", @@ -214,7 +214,7 @@ const GlobalStateProvider = ({ children }) => { { id: 10, sponserName: "Henry Ingram", - sponserNameArabic:"الرجاء إدخال القيمة", + sponserNameArabic: "الرجاء إدخال القيمة", mobileNo: "6666666666", sponserAddress: "707 Spruce St, Fawcett City, USA", accountHolderName: "Henry Ingram", @@ -235,7 +235,7 @@ const GlobalStateProvider = ({ children }) => { { id: 11, sponserName: "Grace Hall", - sponserNameArabic:"الرجاء إدخال القيمة", + sponserNameArabic: "الرجاء إدخال القيمة", mobileNo: "1111111111", sponserAddress: "606 Willow St, Hub City, USA", accountHolderName: "Grace Hall", @@ -256,7 +256,7 @@ const GlobalStateProvider = ({ children }) => { { id: 12, sponserName: "Henry Ingram", - sponserNameArabic:"الرجاء إدخال القيمة", + sponserNameArabic: "الرجاء إدخال القيمة", mobileNo: "6666666666", sponserAddress: "707 Spruce St, Fawcett City, USA", accountHolderName: "Henry Ingram", @@ -275,250 +275,71 @@ const GlobalStateProvider = ({ children }) => { createdAt: "6", }, ]); - + const [investmentType, setInvestmentType] = useState([ + // { + // id: 1, + // investmentName: "Commercial", + // mobileNo: "0987654321", + // investmentAddress: "1725 Slough Ave, Scranton, USA", + // accountHolderName: "Michael Scott", + // bankName: "Dunder Mifflin Bank", + // accountNumber: "1111222233", + // bankBranch: "Scranton Branch", + // branchAddress: "101 Paper St, Scranton, USA", + // ifscCode: "IFSC11111", + // swiftCode: "SWIFT12345", + // routingNumber: "123450987", + // iban: "IBAN1111222233", + // accountType: "checking", + // bankPhoneNumber: "0987654321", + // bankEmail: "michael.scott@example.com", + // status: true, + // createdAt: "45", + // }, { id: 1, - investmentName: "Michael Scott", - mobileNo: "0987654321", - investmentAddress: "1725 Slough Ave, Scranton, USA", - accountHolderName: "Michael Scott", - bankName: "Dunder Mifflin Bank", - accountNumber: "1111222233", - bankBranch: "Scranton Branch", - branchAddress: "101 Paper St, Scranton, USA", - ifscCode: "IFSC11111", - swiftCode: "SWIFT12345", - routingNumber: "123450987", - iban: "IBAN1111222233", - accountType: "checking", - bankPhoneNumber: "0987654321", - bankEmail: "michael.scott@example.com", + investmentName: "Commercial", + description: "Investment Private Company", status: true, - createdAt: "45", }, { id: 2, - investmentName: "Pam Beesly", - mobileNo: "1234509876", - investmentAddress: "3487 Palm St, Scranton, USA", - accountHolderName: "Pam Beesly", - bankName: "Dunder Mifflin Bank", - accountNumber: "4444555566", - bankBranch: "Scranton Branch", - branchAddress: "101 Paper St, Scranton, USA", - ifscCode: "IFSC44444", - swiftCode: "SWIFT54321", - routingNumber: "543211234", - iban: "IBAN4444555566", - accountType: "savings", - bankPhoneNumber: "1234509876", - bankEmail: "pam.beesly@example.com", - status: false, - createdAt: "45", + investmentName: "Commercial", + description: "Investment Private", + status: true, }, { id: 3, - investmentName: "Jim Halpert", - mobileNo: "2345678901", - investmentAddress: "5701 Maple Ave, Scranton, USA", - accountHolderName: "Jim Halpert", - bankName: "Dunder Mifflin Bank", - accountNumber: "7777888899", - bankBranch: "Scranton Branch", - branchAddress: "101 Paper St, Scranton, USA", - ifscCode: "IFSC77777", - swiftCode: "SWIFT87654", - routingNumber: "987654321", - iban: "IBAN7777888899", - accountType: "business", - bankPhoneNumber: "2345678901", - bankEmail: "jim.halpert@example.com", + investmentName: "Commercial", + description: "Investment Private", status: true, - createdAt: "12", }, { id: 4, - investmentName: "Dwight Schrute", - mobileNo: "3456789012", - investmentAddress: "1725 Slough Ave, Scranton, USA", - accountHolderName: "Dwight Schrute", - bankName: "Dunder Mifflin Bank", - accountNumber: "3333444455", - bankBranch: "Scranton Branch", - branchAddress: "101 Paper St, Scranton, USA", - ifscCode: "IFSC33333", - swiftCode: "SWIFT34567", - routingNumber: "765432109", - iban: "IBAN3333444455", - accountType: "savings", - bankPhoneNumber: "3456789012", - bankEmail: "dwight.schrute@example.com", + investmentName: "Commercial", + description: "Investment Private", status: true, - createdAt: "7", }, { id: 5, - investmentName: "Stanley Hudson", - mobileNo: "4567890123", - investmentAddress: "202 Industrial St, Scranton, USA", - accountHolderName: "Stanley Hudson", - bankName: "Dunder Mifflin Bank", - accountNumber: "5555666677", - bankBranch: "Scranton Branch", - branchAddress: "101 Paper St, Scranton, USA", - ifscCode: "IFSC55555", - swiftCode: "SWIFT45678", - routingNumber: "876543210", - iban: "IBAN5555666677", - accountType: "checking", - bankPhoneNumber: "4567890123", - bankEmail: "stanley.hudson@example.com", - status: false, - createdAt: "4", + investmentName: "Commercial", + description: "Investment Private", + status: true, }, { id: 6, - investmentName: "Angela Martin", - mobileNo: "5678901234", - investmentAddress: "7777 Cat Ave, Scranton, USA", - accountHolderName: "Angela Martin", - bankName: "Dunder Mifflin Bank", - accountNumber: "8888999900", - bankBranch: "Scranton Branch", - branchAddress: "101 Paper St, Scranton, USA", - ifscCode: "IFSC88888", - swiftCode: "SWIFT56789", - routingNumber: "987654321", - iban: "IBAN8888999900", - accountType: "business", - bankPhoneNumber: "5678901234", - bankEmail: "angela.martin@example.com", + investmentName: "Commercial", + description: "Investment Private", status: true, - createdAt: "2", }, { id: 7, - investmentName: "Kevin Malone", - mobileNo: "6789012345", - investmentAddress: "3333 Cookie Ln, Scranton, USA", - accountHolderName: "Kevin Malone", - bankName: "Dunder Mifflin Bank", - accountNumber: "9999000011", - bankBranch: "Scranton Branch", - branchAddress: "101 Paper St, Scranton, USA", - ifscCode: "IFSC99999", - swiftCode: "SWIFT67890", - routingNumber: "876543210", - iban: "IBAN9999000011", - accountType: "savings", - bankPhoneNumber: "6789012345", - bankEmail: "kevin.malone@example.com", - status: false, - createdAt: "9", - }, - { - id: 8, - investmentName: "Phyllis Vance", - mobileNo: "7890123456", - investmentAddress: "4545 Knitting Way, Scranton, USA", - accountHolderName: "Phyllis Vance", - bankName: "Dunder Mifflin Bank", - accountNumber: "0000111122", - bankBranch: "Scranton Branch", - branchAddress: "101 Paper St, Scranton, USA", - ifscCode: "IFSC00000", - swiftCode: "SWIFT78901", - routingNumber: "123456789", - iban: "IBAN0000111122", - accountType: "checking", - bankPhoneNumber: "7890123456", - bankEmail: "phyllis.vance@example.com", + investmentName: "Commercial", + description: "Investment Private", status: true, - createdAt: "8", - }, - { - id: 9, - investmentName: "Meredith Palmer", - mobileNo: "8901234567", - investmentAddress: "6666 Booze Blvd, Scranton, USA", - accountHolderName: "Meredith Palmer", - bankName: "Dunder Mifflin Bank", - accountNumber: "1111222233", - bankBranch: "Scranton Branch", - branchAddress: "101 Paper St, Scranton, USA", - ifscCode: "IFSC11111", - swiftCode: "SWIFT89012", - routingNumber: "123450987", - iban: "IBAN1111222233", - accountType: "business", - bankPhoneNumber: "8901234567", - bankEmail: "meredith.palmer@example.com", - status: true, - createdAt: "1" - }, - { - id: 10, - investmentName: "Ryan Howard", - mobileNo: "9012345678", - investmentAddress: "7777 Temp Way, Scranton, USA", - accountHolderName: "Ryan Howard", - bankName: "Dunder Mifflin Bank", - accountNumber: "2222333344", - bankBranch: "Scranton Branch", - branchAddress: "101 Paper St, Scranton, USA", - ifscCode: "IFSC22222", - swiftCode: "SWIFT90123", - routingNumber: "234561098", - iban: "IBAN2222333344", - accountType: "savings", - bankPhoneNumber: "9012345678", - bankEmail: "ryan.howard@example.com", - status: false, - createdAt: "6", - }, - { - id: 11, - investmentName: "Oscar Martinez", - mobileNo: "0123456789", - investmentAddress: "2222 Math St, Scranton, USA", - accountHolderName: "Oscar Martinez", - bankName: "Dunder Mifflin Bank", - accountNumber: "3333444455", - bankBranch: "Scranton Branch", - branchAddress: "101 Paper St, Scranton, USA", - ifscCode: "IFSC33333", - swiftCode: "SWIFT01234", - routingNumber: "345671209", - iban: "IBAN3333444455", - accountType: "business", - bankPhoneNumber: "0123456789", - bankEmail: "oscar.martinez@example.com", - status: true, - createdAt: "1", - }, - { - id: 12, - investmentName: "Kelly Kapoor", - mobileNo: "9876543210", - investmentAddress: "4444 Fashion Ave, Scranton, USA", - accountHolderName: "Kelly Kapoor", - bankName: "Dunder Mifflin Bank", - accountNumber: "4444555566", - bankBranch: "Scranton Branch", - branchAddress: "101 Paper St, Scranton, USA", - ifscCode: "IFSC44444", - swiftCode: "SWIFT23456", - routingNumber: "456781320", - iban: "IBAN4444555566", - accountType: "savings", - bankPhoneNumber: "9876543210", - bankEmail: "kelly.kapoor@example.com", - status: false, - createdAt: "6", }, ]); - const [investment, setInvestment] = useState([ // { diff --git a/src/Layout/DefaultLayout.jsx b/src/Layout/DefaultLayout.jsx index 124bd88..b06f923 100644 --- a/src/Layout/DefaultLayout.jsx +++ b/src/Layout/DefaultLayout.jsx @@ -64,7 +64,7 @@ import { MdNotificationsNone, MdOutlineAddChart } from "react-icons/md"; import { HiOutlineChartSquareBar } from "react-icons/hi"; import { GrManual } from "react-icons/gr"; import { LuContact } from "react-icons/lu"; -import shield from "../assets/shield.png" +import shield from "../assets/shield.png"; import SplashScreen from "../Pages/SplashScreen"; const DashboardLayout = () => { @@ -74,9 +74,28 @@ const DashboardLayout = () => { const path = location.pathname; const [isDrawerOpen, setIsDrawerOpen] = useState(false); const [openDrawerClick, setOpenDrawerClick] = useState(true); - const { setIsAuthenticate, colorMode, toggleColorMode, setSlideFormRight, slideFromRight } = useContext(GlobalStateContext); + const { + setIsAuthenticate, + colorMode, + toggleColorMode, + setSlideFormRight, + slideFromRight, + } = useContext(GlobalStateContext); const [isSplashVisible, setSplashVisible] = useState(true); + const [openIndex, setOpenIndex] = useState(null); + useEffect(() => { + const savedIndex = localStorage.getItem("openAccordionIndex"); + if (savedIndex !== null) { + setOpenIndex(parseInt(savedIndex)); + } + }, []); + + const handleAccordionChange = (index) => { + const newIndex = openIndex === index ? null : index; + setOpenIndex(newIndex); + localStorage.setItem("openAccordionIndex", newIndex); + }; useEffect(() => { // Set a timer to hide the splash screen after 3 seconds @@ -355,12 +374,11 @@ const DashboardLayout = () => { height={"10%"} > {isDrawerOpen || openDrawerClick ? ( - Logo ) : ( @@ -368,7 +386,7 @@ const DashboardLayout = () => { style={{ width: 30, }} - src={colorMode === "light"?logoMini : logoMiniDark } + src={colorMode === "light" ? logoMini : logoMiniDark} alt="Logo" /> )} @@ -376,9 +394,20 @@ const DashboardLayout = () => { - + {nav.map(({ title, type, Icon, submenu, path }, index) => { if (type === "accordion") { return ( @@ -398,14 +427,17 @@ const DashboardLayout = () => { alignItems={"center"} > {/* {Icon && title === "Admin" ? : } */} - {Icon && } + {Icon && ( + + )} @@ -567,7 +599,6 @@ const DashboardLayout = () => { style={{ width: `calc(100% - ${isDrawerOpen || openDrawerClick ? 232 : 74}px)`, transition: "width 0.3s ease-in-out", - }} > {/*
@@ -594,7 +625,7 @@ const DashboardLayout = () => { style={{ width: isDrawerOpen || openDrawerClick ? 232 : 74, transition: "width 0.3s ease-in-out", // Smooth transition for width change - // overflow: "hidden", + // overflow: "hidden", backgroundColor: "#0041180A", position: "relative", // backgroundColor: "#002F0F", @@ -809,7 +840,7 @@ const DashboardLayout = () => { }} > {isDrawerOpen || openDrawerClick ? ( - + ) : ( )} diff --git a/src/Pages/Login.jsx b/src/Pages/Login.jsx index ee3f309..15efb9b 100644 --- a/src/Pages/Login.jsx +++ b/src/Pages/Login.jsx @@ -93,7 +93,7 @@ const Login = () => { justifyContent: "center", position: "relative", overflow: "hidden", - backgroundColor:"#0041180A" + backgroundColor: "#0041180A", }} className="rubix-primary" > diff --git a/src/Pages/Master/ExchangeRate/ExchangeRate.jsx b/src/Pages/Master/ExchangeRate/ExchangeRate.jsx index bd98731..f117014 100644 --- a/src/Pages/Master/ExchangeRate/ExchangeRate.jsx +++ b/src/Pages/Master/ExchangeRate/ExchangeRate.jsx @@ -71,7 +71,7 @@ const ExchangeRate = () => { // ====================================================[Table Setup]================================================================ const tableHeadRow = [ - // "Sr No.", + "Sr.No", "From currency", "To currency", "Effective from", @@ -81,24 +81,23 @@ const ExchangeRate = () => { ]; const extractedArray = filteredData?.map((item, index) => ({ - id: item?.id, - // "Sr No.": ( - // - // {index + 1}. - // - // ), + "Sr.No": ( + + {index + 1}. + + ), "From currency": ( {item.fromCurr} @@ -109,7 +108,7 @@ const ExchangeRate = () => { justifyContent={slideFromRight ? "right" : "left"} as={"span"} color={"gray.600"} - fontWeight={'600'} + fontWeight={"600"} className="d-flex align-items-center fw- web-text-small" > {item.toCurr} @@ -120,7 +119,7 @@ const ExchangeRate = () => { justifyContent={slideFromRight ? "right" : "left"} as={"span"} color={"gray.600"} - fontWeight={'600'} + fontWeight={"600"} className="d-flex align-items-center web-text-small" > {formatDate(item.effectFrom)} @@ -131,7 +130,7 @@ const ExchangeRate = () => { justifyContent={slideFromRight ? "right" : "left"} as={"span"} color={"gray.600"} - fontWeight={'600'} + fontWeight={"600"} className="d-flex align-items-center web-text-small" > {formatDate(item.effectTill)} @@ -142,7 +141,7 @@ const ExchangeRate = () => { justifyContent={slideFromRight ? "right" : "left"} as={"span"} color={"gray.600"} - fontWeight={'600'} + fontWeight={"600"} className="d-flex align-items-center web-text-small" > {item.rate} @@ -153,7 +152,7 @@ const ExchangeRate = () => { // - + ), })); diff --git a/src/Pages/Master/InvestmentType/AddInvestmentType.jsx b/src/Pages/Master/InvestmentType/AddInvestmentType.jsx index 5df154f..317c796 100644 --- a/src/Pages/Master/InvestmentType/AddInvestmentType.jsx +++ b/src/Pages/Master/InvestmentType/AddInvestmentType.jsx @@ -16,13 +16,15 @@ import FormInputMain from "../../../Components/FormInputMain"; export const addInvestmentType = yup.object().shape({ investmentName: yup.string().required("Investment name is required"), - mobileNo: yup.string().required("Mobile no is required"), - investmentAddress: yup.string().required("Investment address is required"), + // investmentNameArabic: yup.string().required("Investment name is required"), + // mobileNo: yup.string().required("Mobile no is required"), + description: yup.string().required("Description is required"), + // descriptionArabic: yup.string().required("Description address is required"), - bankName: yup.string().required("Bank Name is required"), - accountNumber: yup.string().required("Account Number is required"), - swiftCode: yup.string().required("SWIFT/BIC Code is required"), - bankEmail: yup.string().email("Invalid email format"), + // bankName: yup.string().required("Bank Name is required"), + // accountNumber: yup.string().required("Account Number is required"), + // swiftCode: yup.string().required("SWIFT/BIC Code is required"), + // bankEmail: yup.string().email("Invalid email format"), // routingNumber: yup.string().required("Routing Number is required"), // iban: yup.string().required("IBAN is required"), diff --git a/src/Pages/Master/InvestmentType/InvestmentType.jsx b/src/Pages/Master/InvestmentType/InvestmentType.jsx index 8b9d961..360ec93 100644 --- a/src/Pages/Master/InvestmentType/InvestmentType.jsx +++ b/src/Pages/Master/InvestmentType/InvestmentType.jsx @@ -40,7 +40,7 @@ import { debounce } from "./AddInvestmentType"; const formatDate = (date) => new Date(date).toLocaleDateString(); // Simple date formatter const InvestmentType = () => { - const navigate = useNavigate() + const navigate = useNavigate(); const toast = useToast(); const { investmentType, setInvestmentType, slideFromRight } = useContext(GlobalStateContext); @@ -63,18 +63,19 @@ const InvestmentType = () => { // ====================================================[Table Setup]================================================================ const tableHeadRow = [ - "Investment name", - "Address", - "Mobile no", + "Sr.no", + "Investment Type Name", + "Description", "Status", - "Created At", "Action", ]; const handleUpdateStatus = debounce((id) => { setInvestmentType((prevInvestmentType) => prevInvestmentType.map((investmentType) => - investmentType.id === id ? { ...investmentType, status: !investmentType.status } : investmentType + investmentType.id === id + ? { ...investmentType, status: !investmentType.status } + : investmentType ) ); toast({ @@ -101,9 +102,19 @@ const InvestmentType = () => { return nameMatches; }); - const extractedArray = filteredData?.map((item) => ({ - id: item?.id, - "Investment name": ( + const extractedArray = filteredData?.map((item, index) => ({ + "Sr.no": ( + + {index + 1} + + ), + "Investment Type Name": ( { {item.investmentName} ), - Address: ( - + Description: ( + - {item.investmentAddress} - - - ), - "Mobile no": ( - - - {item.mobileNo} + {item.description} ), @@ -147,40 +151,39 @@ const InvestmentType = () => { // // ), - "Created At": ( - - - {formatDate(item.createdAt)} - - {/* - - - - - - - Edit - - - View - - { - setActionId(item?.id); - setDeleteAlert(true); - }} - className="web-text-medium" - > - Delete - - - - */} - - ), + // "Created At": ( + // + // + // {formatDate(item.createdAt)} + // + // + // + // + // + // + // + // + // Edit + // + // + // View + // + // { + // setActionId(item?.id); + // setDeleteAlert(true); + // }} + // className="web-text-medium" + // > + // Delete + // + // + // + // + // + // ), Action: ( - - + { - - { placement="top" > - - + */} { - ), diff --git a/src/Pages/Master/InvestmentType/ViewInvestmentType.jsx b/src/Pages/Master/InvestmentType/ViewInvestmentType.jsx index 46380e9..33f2a3f 100644 --- a/src/Pages/Master/InvestmentType/ViewInvestmentType.jsx +++ b/src/Pages/Master/InvestmentType/ViewInvestmentType.jsx @@ -9,6 +9,7 @@ import { useForm } from "react-hook-form"; // assuming react-hook-form is used import { OPACITY_ON_LOAD } from "../../../Layout/animations"; const ViewInvestmentType = () => { + const navigate = useNavigate(); const params = useParams(); const { investmentType } = useContext(GlobalStateContext); const { reset } = useForm(); // assuming react-hook-form