From e23b6357458d4081bb1c28f0427f35c2e355efda Mon Sep 17 00:00:00 2001 From: rockyeverlast Date: Mon, 1 Jul 2024 12:53:57 +0530 Subject: [PATCH 1/4] accordion expanded on reload --- src/Layout/DefaultLayout.jsx | 55 ++++++++++++++++++++++++++++-------- 1 file changed, 43 insertions(+), 12 deletions(-) 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 ? ( - + ) : ( )} From ff868b0570d93063e619bbd7821a9c0cc7fee185 Mon Sep 17 00:00:00 2001 From: rockyeverlast Date: Mon, 1 Jul 2024 13:11:15 +0530 Subject: [PATCH 2/4] fixed after login navigation to /sponser --- src/Pages/Login.jsx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Pages/Login.jsx b/src/Pages/Login.jsx index ee3f309..e83ff08 100644 --- a/src/Pages/Login.jsx +++ b/src/Pages/Login.jsx @@ -56,7 +56,7 @@ const Login = () => { }); Cookies.set("isAuthenticated", true, { expires: 7 }); - navigate("/"); + navigate("/sponser"); }, 2000); // 3-second delay } else { return setTimeout(() => { @@ -93,7 +93,7 @@ const Login = () => { justifyContent: "center", position: "relative", overflow: "hidden", - backgroundColor:"#0041180A" + backgroundColor: "#0041180A", }} className="rubix-primary" > From 0677d2d9342b760e846c40fb2f850a6bd6ba9f53 Mon Sep 17 00:00:00 2001 From: rockyeverlast Date: Mon, 1 Jul 2024 13:53:03 +0530 Subject: [PATCH 3/4] reverted login redirect to /sponser --- src/Pages/Login.jsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Pages/Login.jsx b/src/Pages/Login.jsx index e83ff08..15efb9b 100644 --- a/src/Pages/Login.jsx +++ b/src/Pages/Login.jsx @@ -56,7 +56,7 @@ const Login = () => { }); Cookies.set("isAuthenticated", true, { expires: 7 }); - navigate("/sponser"); + navigate("/"); }, 2000); // 3-second delay } else { return setTimeout(() => { From 3c6d5fb5f9f833c3c8965cd2254cb6e9e93958d1 Mon Sep 17 00:00:00 2001 From: rockyeverlast Date: Tue, 2 Jul 2024 19:48:40 +0530 Subject: [PATCH 4/4] Changes and updates to Exchange rate and Investment type --- src/Contexts/GlobalStateProvider.jsx | 277 ++++-------------- src/Pages/IO_Management/CreateIO.jsx | 179 ++++++----- .../Master/ExchangeRate/ExchangeRate.jsx | 37 ++- .../InvestmentType/AddInvestmentType.jsx | 75 +++-- .../Master/InvestmentType/InvestmentType.jsx | 122 ++++---- .../InvestmentType/ViewInvestmentType.jsx | 23 +- 6 files changed, 268 insertions(+), 445 deletions(-) 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/Pages/IO_Management/CreateIO.jsx b/src/Pages/IO_Management/CreateIO.jsx index 724cc42..70a24c9 100644 --- a/src/Pages/IO_Management/CreateIO.jsx +++ b/src/Pages/IO_Management/CreateIO.jsx @@ -127,96 +127,91 @@ const CreateIO = () => { label: item.sponserName, })); - - const [investForm, setInvestForm] = useState( - [ - { - label: "Investment object name", - name: "ioName", - type: "text", - isRequired: true, - }, - { - label: "Investment object", - name: "ioNameArabic", - placeHolder: "الرجاء إدخال القيمة", - arabic: true, - isRequired: true, - }, - { - label: "Destributed Amount", - placeHolder: "$00.0", - helperText: "Please enter value in $", - name: "destributedAmount", - type: "number", - isRequired: true, - }, - { - label: "Min Invest", - placeHolder: "$00.00", - helperText: "Please enter value in $", - name: "miniInvest", - type: "number", - isRequired: true, - }, - { - label: "Year", - name: "year", - type: "select", - options: years, - isRequired: true, - }, - { - label: "Quaterly", - name: "quaterly", - type: "select", - options: [ - { label: "Q1", value: "Q1" }, - { label: "Q2", value: "Q2" }, - { label: "Q3", value: "Q3" }, - { label: "Q4", value: "Q4" }, - ], - isRequired: true, - }, - { - label: "Sponsers Name", - name: "sponserName", - type: "select", - options: sponserOptions, - isRequired: true, - }, - { - label: "Target close", - name: "targetClose", - type: "date", - isRequired: true, - }, - { - label: "Tenure", - name: "tenure", - type: "number", - isRequired: true, - }, - { - label: "Annual yeild", - placeHolder: "00.00%", - helperText: "Please enter value in percentage", - name: "annualyield", - type: "number", - isRequired: true, - }, - { - label: "Annual return", - placeHolder: "00.00%", - helperText: "Please enter value in percentage", - name: "annualReturn", - type: "number", - isRequired: true, - }, - ] - ); - - + const [investForm, setInvestForm] = useState([ + { + label: "Investment object name", + name: "ioName", + type: "text", + isRequired: true, + }, + { + label: "Investment object", + name: "ioNameArabic", + placeHolder: "الرجاء إدخال القيمة", + arabic: true, + isRequired: true, + }, + { + label: "Destributed Amount", + placeHolder: "$00.0", + helperText: "Please enter value in $", + name: "destributedAmount", + type: "number", + isRequired: true, + }, + { + label: "Min Invest", + placeHolder: "$00.00", + helperText: "Please enter value in $", + name: "miniInvest", + type: "number", + isRequired: true, + }, + { + label: "Year", + name: "year", + type: "select", + options: years, + isRequired: true, + }, + { + label: "Quaterly", + name: "quaterly", + type: "select", + options: [ + { label: "Q1", value: "Q1" }, + { label: "Q2", value: "Q2" }, + { label: "Q3", value: "Q3" }, + { label: "Q4", value: "Q4" }, + ], + isRequired: true, + }, + { + label: "Sponsers Name", + name: "sponserName", + type: "select", + options: sponserOptions, + isRequired: true, + }, + { + label: "Target close", + name: "targetClose", + type: "date", + isRequired: true, + }, + { + label: "Tenure", + name: "tenure", + type: "number", + isRequired: true, + }, + { + label: "Annual yeild", + placeHolder: "00.00%", + helperText: "Please enter value in percentage", + name: "annualyield", + type: "number", + isRequired: true, + }, + { + label: "Annual return", + placeHolder: "00.00%", + helperText: "Please enter value in percentage", + name: "annualReturn", + type: "number", + isRequired: true, + }, + ]); const handleBannerImageChange = (e) => { const file = e.target.files[0]; @@ -262,7 +257,7 @@ const CreateIO = () => { // Function to remove a specific image const removeOtherImage = (index) => { const newImageData = otherImageData.filter((_, i) => i !== index); - const newSelectedImageData = selectedOtherImageData.filter( + const newSelectedImageData = selectedOtherImageData.filter( (_, i) => i !== index ); @@ -440,7 +435,7 @@ const CreateIO = () => { bgGradient="linear(to-tr, #000000, #004118)" > {charges.map(({ title, value }, index) => ( - + { // ====================================================[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 b751bb1..c5f8058 100644 --- a/src/Pages/Master/InvestmentType/AddInvestmentType.jsx +++ b/src/Pages/Master/InvestmentType/AddInvestmentType.jsx @@ -1,12 +1,6 @@ import React, { useContext } from "react"; import { OPACITY_ON_LOAD } from "../../../Layout/animations"; -import { - Box, - Divider, - Heading, - Button, - Text, -} from "@chakra-ui/react"; +import { Box, Divider, Heading, Button, Text } from "@chakra-ui/react"; import { useForm, Controller } from "react-hook-form"; import { yupResolver } from "@hookform/resolvers/yup"; import * as yup from "yup"; @@ -19,13 +13,15 @@ import { v4 as uuidv4 } from "uuid"; const schema = 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"), @@ -47,8 +43,7 @@ export function debounce(func, delay) { const AddInvestmentType = () => { const navigate = useNavigate(); - const { investmentType, setInvestmentType } = - useContext(GlobalStateContext); + const { investmentType, setInvestmentType } = useContext(GlobalStateContext); const { control, handleSubmit, @@ -81,42 +76,45 @@ const AddInvestmentType = () => { - + - - - + {/* Bank Details @@ -128,13 +126,6 @@ const AddInvestmentType = () => { flexWrap={"wrap"} gap={4} > - {/* */} { /> )} - + */} - + - - { placement="top" > - - + */} { - ), diff --git a/src/Pages/Master/InvestmentType/ViewInvestmentType.jsx b/src/Pages/Master/InvestmentType/ViewInvestmentType.jsx index 4eaf235..c3c4171 100644 --- a/src/Pages/Master/InvestmentType/ViewInvestmentType.jsx +++ b/src/Pages/Master/InvestmentType/ViewInvestmentType.jsx @@ -1,12 +1,21 @@ -import { Box, FormControl, FormLabel, Image, Text } from "@chakra-ui/react"; +import { + Box, + Button, + FormControl, + FormLabel, + Image, + Text, +} from "@chakra-ui/react"; // import error from "../assets/Error.svg" import robot from "../../../assets/robot.png"; import { OPACITY_ON_LOAD } from "../../../Layout/animations"; -import { useParams } from "react-router-dom"; +import { useNavigate, useParams } from "react-router-dom"; import GlobalStateContext from "../../../Contexts/GlobalStateContext"; import { useContext } from "react"; +import { ArrowBackIcon } from "@chakra-ui/icons"; // import robot from "../assets/robot.png" const ViewInvestmentType = () => { + const navigate = useNavigate(); const params = useParams(); const { investmentType } = useContext(GlobalStateContext); const id = params?.id; @@ -17,6 +26,8 @@ const ViewInvestmentType = () => { return ( + navigate(-1)} /> + @@ -33,19 +44,19 @@ const ViewInvestmentType = () => { {found?.investmentName} - + {/* ADDRESS {found?.investmentAddress} - + */} - + {/* Moobile no {found?.mobileNo} - + */}