From 0e1a8f3873e0ce72916448536c47d14a6be40e20 Mon Sep 17 00:00:00 2001 From: YasinShaikh123 <123150391+YasinShaikh123@users.noreply.github.com> Date: Fri, 5 Jul 2024 16:16:03 +0530 Subject: [PATCH] investDoc --- src/Contexts/GlobalStateProvider.jsx | 52 +-- src/Pages/IO_Management/CreateIO/CreateIO.jsx | 324 +++--------------- 2 files changed, 73 insertions(+), 303 deletions(-) diff --git a/src/Contexts/GlobalStateProvider.jsx b/src/Contexts/GlobalStateProvider.jsx index 17dd553..7d763d0 100644 --- a/src/Contexts/GlobalStateProvider.jsx +++ b/src/Contexts/GlobalStateProvider.jsx @@ -280,45 +280,27 @@ const GlobalStateProvider = ({ children }) => { const [create, setCreate] = useState([ { id: 1, - sponserName: "John Doe", - sponserNameArabic:"الرجاء إدخال القيمة", - mobileNo: "1234567890", - sponserAddress: "123 Main St, Springfield, USA", - accountHolderName: "John Doe", - bankName: "Example Bank", - accountNumber: "1234567890", - bankBranch: "Main Branch", - branchAddress: "456 Elm St, Springfield, USA", - ifscCode: "IFSC12345", - swiftCode: "SWIFT56789", - routingNumber: "987654321", - iban: "IBAN987654321", - accountType: "savings", - bankPhoneNumber: "9876543210", - bankEmail: "john.doe@example.com", + sponserName: "Commercial", + description: "Investment Private Company", status: true, - createdAt: "45", }, { id: 2, - sponserName: "Jane Smith", - sponserNameArabic:"الرجاء إدخال القيمة", - mobileNo: "9876543210", - sponserAddress: "456 Oak St, Metropolis, USA", - accountHolderName: "Jane Smith", - bankName: "Another Bank", - accountNumber: "0987654321", - bankBranch: "Downtown Branch", - branchAddress: "789 Pine St, Metropolis, USA", - ifscCode: "IFSC54321", - swiftCode: "SWIFT98765", - routingNumber: "123456789", - iban: "IBAN123456789", - accountType: "checking", - bankPhoneNumber: "1234567890", - bankEmail: "jane.smith@example.com", - status: false, - createdAt: "45", + sponserName: "Commercial", + description: "Investment Private", + status: true, + }, + { + id: 3, + sponserName: "Commercial", + description: "Investment Private", + status: true, + }, + { + id: 4, + sponserName: "Commercial", + description: "Investment Private", + status: true, }, ]); diff --git a/src/Pages/IO_Management/CreateIO/CreateIO.jsx b/src/Pages/IO_Management/CreateIO/CreateIO.jsx index feaca28..6bada19 100644 --- a/src/Pages/IO_Management/CreateIO/CreateIO.jsx +++ b/src/Pages/IO_Management/CreateIO/CreateIO.jsx @@ -116,12 +116,6 @@ const years = Array.from( (_, i) => startYear + i ).map((year) => ({ value: year, label: year })); - - - - - - const CreateIO = () => { const navigate = useNavigate(); const { create, setCreate, sponser, setSponser, investment, setInvestment } = @@ -153,14 +147,46 @@ const CreateIO = () => { }); const tabs = [ - { label: 'IO Details', content: }, - { label: 'Investment documents', content: }, - { label: 'Key merits', content: }, - { label: 'IO artifacts', content: }, - { label: 'Investors', content: }, - { label: 'IO Cash Details', content: }, - { label: 'IO NAV Details', content: }, - { label: 'Distribution', content: }, + { + label: "IO Details", + content: , + isDisabled: false, + }, + { + label: "Investment documents", + content: , + isDisabled: false, + }, + { + label: "Key merits", + content: , + isDisabled: true, + }, + { + label: "IO artifacts", + content: , + isDisabled: true, + }, + { + label: "Investors", + content: , + isDisabled: true, + }, + { + label: "IO Cash Details", + content: , + isDisabled: true, + }, + { + label: "IO NAV Details", + content: , + isDisabled: true, + }, + { + label: "Distribution", + content: , + isDisabled: true, + }, ]; useEffect(() => { @@ -267,267 +293,29 @@ const CreateIO = () => { setSelectedOtherImageData(newSelectedImageData); }; - const keyMerits = [ - { - label: "Name (English)", - placeHolder: " ", - name: "keyname", - type: "text", - isRequired: true, - section: " ", - width: "32.3%", - }, - { - label: "Name (Arabic)", - placeHolder: " ", - name: "keyNameArabic", - type: "text", - isRequired: true, - section: " ", - width: "32.3%", - }, - { - label: "Icon", - placeHolder: " ", - name: "iconUpload", - type: "fileNormal", - isRequired: true, - section: " ", - width: "32.3%", - }, - { - label: "Description (English)", - placeHolder: " ", - name: "keyDescription", - type: "textarea", - isRequired: true, - section: " ", - width: "32.3%", - }, - { - label: "Description (Arabic)", - placeHolder: " ", - name: "keyDescriptionArabic", - type: "textarea", - isRequired: true, - section: " ", - width: "32.3%", - }, - ]; - - const images = [ - { - label: "Banner Images ", - placeHolder: " ", - name: "bannerImages", - type: "fileNormal", - isRequired: true, - section: " ", - width: "32.3%", - }, - - { - label: "Other Images", - placeHolder: " ", - name: "otherImage", - type: "fileNormal", - isRequired: true, - section: " ", - width: "32.3%", - }, - ]; - - const documents = [ - { - label: "Type", - placeHolder: " ", - name: "docType", - type: "text", - isRequired: true, - section: " ", - width: "32.3%", - }, - { - label: "Attachment", - placeHolder: " ", - name: "type", - type: "docAttach", - isRequired: true, - section: " ", - width: "32.3%", - }, - ]; - - const Videos = [ - { - label: "Videos", - placeHolder: " ", - name: "videos", - type: "fileNormal", - isRequired: true, - section: " ", - width: "32.3%", - }, - ]; - - - - const groupedFieldsTwo = keyMerits.reduce((groups, field) => { - const { section } = field; - if (!groups[section]) { - groups[section] = []; - } - groups[section].push(field); - return groups; - }, {}); - - const groupedFieldsThree = images.reduce((groups, field) => { - const { section } = field; - if (!groups[section]) { - groups[section] = []; - } - groups[section].push(field); - return groups; - }, {}); - - const groupedFieldsFour = documents.reduce((groups, field) => { - const { section } = field; - if (!groups[section]) { - groups[section] = []; - } - groups[section].push(field); - return groups; - }, {}); - - const groupedFieldsFive = Videos.reduce((groups, field) => { - const { section } = field; - if (!groups[section]) { - groups[section] = []; - } - groups[section].push(field); - return groups; - }, {}); - return ( - {tabs.map(({label}, index) => ( - - {label} - ))} - {/* - Investment Documents - - - Key Merits - - - IO artifacts - - - Investors - - - IO Cash detail - - - IO NAV detail - - - Distribution - */} + {tabs.map(({ label, isDisabled }, index) => ( + + {label} + + ))} - - {tabs.map(({content}, index) => ( - - {content} - ))} - - - {/* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */} - - - + {tabs.map(({ content }, index) => ( + {content} + ))}