diff --git a/src/Components/DataTable/DataTable.jsx b/src/Components/DataTable/DataTable.jsx index bd4bcf5..e402b87 100644 --- a/src/Components/DataTable/DataTable.jsx +++ b/src/Components/DataTable/DataTable.jsx @@ -1,5 +1,16 @@ import React from "react"; -import { Table, TableContainer, Tbody, Td, Th, Thead, Tr, Skeleton, TableCaption, Tfoot } from "@chakra-ui/react"; +import { + Table, + TableContainer, + Tbody, + Td, + Th, + Thead, + Tr, + Skeleton, + TableCaption, + Tfoot, +} from "@chakra-ui/react"; import EmptySearchList from "../EmptySearchList"; import Pagination from "../Pagination"; @@ -16,7 +27,7 @@ const DataTable = ({ data, isLoading, tableHeadRow, emptyMessage, totalPages }) {tableHeadRow.map((heading, index) => ( - + {isLoading ? : heading} {/* {heading} */} @@ -28,7 +39,15 @@ const DataTable = ({ data, isLoading, tableHeadRow, emptyMessage, totalPages }) ? Array?.from({ length: 10 }).map((_, index) => ( {tableHeadRow.map((_, i) => ( - + ))} @@ -37,7 +56,15 @@ const DataTable = ({ data, isLoading, tableHeadRow, emptyMessage, totalPages }) : data?.map((item, index) => ( {tableHeadRow.map((heading, i) => ( - + {item[heading]} ))} diff --git a/src/Layout/DefaultLayout.jsx b/src/Layout/DefaultLayout.jsx index 3a58b11..5da7434 100644 --- a/src/Layout/DefaultLayout.jsx +++ b/src/Layout/DefaultLayout.jsx @@ -229,6 +229,7 @@ const DashboardLayout = () => { } alignItems="center" overflow="hidden" + textAlign={"left"} > {title} diff --git a/src/Pages/AccountDeletion/DeletionHistory.jsx b/src/Pages/AccountDeletion/DeletionHistory.jsx new file mode 100644 index 0000000..898994f --- /dev/null +++ b/src/Pages/AccountDeletion/DeletionHistory.jsx @@ -0,0 +1,12 @@ +import { Box, Text } from "@chakra-ui/react"; +import { OPACITY_ON_LOAD } from "../../Layout/animations"; + +const DeletionHistory = () => { + return ( + + Account deletion request + + ); +}; + +export default DeletionHistory; diff --git a/src/Pages/AccountDeletion/DeletionRequest.jsx b/src/Pages/AccountDeletion/DeletionRequest.jsx new file mode 100644 index 0000000..c58d7aa --- /dev/null +++ b/src/Pages/AccountDeletion/DeletionRequest.jsx @@ -0,0 +1,12 @@ +import { Box, Text } from "@chakra-ui/react"; +import { OPACITY_ON_LOAD } from "../../Layout/animations"; + +const DeletionRequest = () => { + return ( + + Pending deletion request + + ); +}; + +export default DeletionRequest; diff --git a/src/Pages/Admin/Academy.jsx b/src/Pages/Admin/Academy.jsx new file mode 100644 index 0000000..a41eb07 --- /dev/null +++ b/src/Pages/Admin/Academy.jsx @@ -0,0 +1,12 @@ +import { Box, Text } from "@chakra-ui/react"; +import { OPACITY_ON_LOAD } from "../../Layout/animations"; + +const Academy = () => { + return ( + + Academy Page + + ); +}; + +export default Academy; diff --git a/src/Pages/Admin/BankDetails.jsx b/src/Pages/Admin/BankDetails.jsx new file mode 100644 index 0000000..41896d6 --- /dev/null +++ b/src/Pages/Admin/BankDetails.jsx @@ -0,0 +1,12 @@ +import { Box, Text } from "@chakra-ui/react"; +import { OPACITY_ON_LOAD } from "../../Layout/animations"; + +const BankDetails = () => { + return ( + + Bank Details + + ); +}; + +export default BankDetails; diff --git a/src/Pages/Admin/BankInvestor.jsx b/src/Pages/Admin/BankInvestor.jsx new file mode 100644 index 0000000..f7d24ed --- /dev/null +++ b/src/Pages/Admin/BankInvestor.jsx @@ -0,0 +1,12 @@ +import { Box, Text } from "@chakra-ui/react"; +import { OPACITY_ON_LOAD } from "../../Layout/animations"; + +const BankInvestor = () => { + return ( + + Admin Bank Investor Page + + ); +}; + +export default BankInvestor; diff --git a/src/Pages/Admin/Contact.jsx b/src/Pages/Admin/Contact.jsx new file mode 100644 index 0000000..c0b4704 --- /dev/null +++ b/src/Pages/Admin/Contact.jsx @@ -0,0 +1,12 @@ +import { Box, Text } from "@chakra-ui/react"; +import { OPACITY_ON_LOAD } from "../../Layout/animations"; + +const Contact = () => { + return ( + + Contact Us Page + + ); +}; + +export default Contact; diff --git a/src/Pages/Admin/Notification.jsx b/src/Pages/Admin/Notification.jsx new file mode 100644 index 0000000..57ffe15 --- /dev/null +++ b/src/Pages/Admin/Notification.jsx @@ -0,0 +1,12 @@ +import { Box, Text } from "@chakra-ui/react"; +import { OPACITY_ON_LOAD } from "../../Layout/animations"; + +const Notification = () => { + return ( + + Notification + + ); +}; + +export default Notification; diff --git a/src/Pages/Admin/Users.jsx b/src/Pages/Admin/Users.jsx new file mode 100644 index 0000000..c820738 --- /dev/null +++ b/src/Pages/Admin/Users.jsx @@ -0,0 +1,12 @@ +import { Box, Text } from "@chakra-ui/react"; +import { OPACITY_ON_LOAD } from "../../Layout/animations"; + +const Users = () => { + return ( + + Users Page + + ); +}; + +export default Users; diff --git a/src/Pages/IO_Management/Create.jsx b/src/Pages/IO_Management/Create.jsx new file mode 100644 index 0000000..6fd4d27 --- /dev/null +++ b/src/Pages/IO_Management/Create.jsx @@ -0,0 +1,13 @@ +import { Box, Text } from "@chakra-ui/react"; +import { OPACITY_ON_LOAD } from "../../Layout/animations"; + + +const Create = () => { + return ( + + IO management Create + + ); +}; + +export default Create; diff --git a/src/Pages/IO_Management/View.jsx b/src/Pages/IO_Management/View.jsx new file mode 100644 index 0000000..13a7dc7 --- /dev/null +++ b/src/Pages/IO_Management/View.jsx @@ -0,0 +1,13 @@ +import { Box, Text } from "@chakra-ui/react"; +import { OPACITY_ON_LOAD } from "../../Layout/animations"; + + +const View = () => { + return ( + + IO management View + + ); +}; + +export default View; diff --git a/src/Pages/Investment/Investment.jsx b/src/Pages/Investment/Investment.jsx deleted file mode 100644 index e003b93..0000000 --- a/src/Pages/Investment/Investment.jsx +++ /dev/null @@ -1,11 +0,0 @@ -import { Box } from '@chakra-ui/react' -import React from 'react' -import { OPACITY_ON_LOAD } from '../../Layout/animations' - -const Investment = () => { - return ( - - ) -} - -export default Investment \ No newline at end of file diff --git a/src/Pages/InvestorUpgrade/InvestorPendingRequest.jsx b/src/Pages/InvestorUpgrade/InvestorPendingRequest.jsx new file mode 100644 index 0000000..df6bdcd --- /dev/null +++ b/src/Pages/InvestorUpgrade/InvestorPendingRequest.jsx @@ -0,0 +1,12 @@ +import { Box, Text } from "@chakra-ui/react"; +import { OPACITY_ON_LOAD } from "../../Layout/animations"; + +const InvestorPendingRequest = () => { + return ( + + Investor pending request + + ); +}; + +export default InvestorPendingRequest; diff --git a/src/Pages/InvestorUpgrade/UpgradeHistory.jsx b/src/Pages/InvestorUpgrade/UpgradeHistory.jsx new file mode 100644 index 0000000..f10fc77 --- /dev/null +++ b/src/Pages/InvestorUpgrade/UpgradeHistory.jsx @@ -0,0 +1,12 @@ +import { Box, Text } from "@chakra-ui/react"; +import { OPACITY_ON_LOAD } from "../../Layout/animations"; + +const upgradeHistory = () => { + return ( + + Investor upgradation History + + ); +}; + +export default upgradeHistory; diff --git a/src/Pages/Investor_Management/InvestorDetails.jsx b/src/Pages/Investor_Management/InvestorDetails.jsx new file mode 100644 index 0000000..b4ecb13 --- /dev/null +++ b/src/Pages/Investor_Management/InvestorDetails.jsx @@ -0,0 +1,12 @@ +import { Box, Text } from "@chakra-ui/react"; +import { OPACITY_ON_LOAD } from "../../Layout/animations"; + +const InvestorDetails = () => { + return ( + + Investor Details Page + + ); +}; + +export default InvestorDetails; diff --git a/src/Pages/Investor_Management/InvestorTransactions.jsx b/src/Pages/Investor_Management/InvestorTransactions.jsx new file mode 100644 index 0000000..411de20 --- /dev/null +++ b/src/Pages/Investor_Management/InvestorTransactions.jsx @@ -0,0 +1,12 @@ +import { Box, Text } from "@chakra-ui/react"; +import { OPACITY_ON_LOAD } from "../../Layout/animations"; + +const InvestorTransactions = () => { + return ( + + Investor Transactions Page + + ); +}; + +export default InvestorTransactions; diff --git a/src/Pages/Master/ExchangeRate/ExchangeRate.jsx b/src/Pages/Master/ExchangeRate/ExchangeRate.jsx index ccbc6d8..b5193c9 100644 --- a/src/Pages/Master/ExchangeRate/ExchangeRate.jsx +++ b/src/Pages/Master/ExchangeRate/ExchangeRate.jsx @@ -1,11 +1,225 @@ -import { Box } from '@chakra-ui/react' -import React from 'react' -import { OPACITY_ON_LOAD } from '../../../Layout/animations' +import { + Avatar, + Badge, + Box, + Button, + HStack, + Input, + Menu, + MenuButton, + MenuItem, + MenuList, + Portal, + Select, + Switch, + Tag, + Text, +} from "@chakra-ui/react"; +import React, { useContext, useEffect, useState } from "react"; +import { OPACITY_ON_LOAD } from "../../../Layout/animations"; +import DataTable from "../../../Components/DataTable/DataTable"; +import { HiDotsVertical } from "react-icons/hi"; +import { Link, Link as RouterLink } from "react-router-dom"; +import { AddIcon, EmailIcon } from "@chakra-ui/icons"; +import Pagination from "../../../Components/Pagination"; +import GlobalStateContext from "../../../Contexts/GlobalStateContext"; +import CustomAlertDialog from "../../../Components/CustomAlertDialog"; + +const formatDate = (date) => new Date(date).toLocaleDateString(); // Simple date formatter const ExchangeRate = () => { - return ( - - ) -} + const { sponser, setSponser } = useContext(GlobalStateContext); + const [searchTerm, setSearchTerm] = useState(""); + const [isLoading, setIsLoading] = useState(true); + const [deleteAlert, setDeleteAlert] = useState(false); + const [actionId, setActionId] = useState(false); -export default ExchangeRate \ No newline at end of file + useEffect(() => { + // Simulate loading + const timer = setTimeout(() => { + setIsLoading(false); + }, 1500); + + // Cleanup the timer on component unmount + return () => clearTimeout(timer); + }, []); + + // ====================================================[Table Setup]================================================================ + const tableHeadRow = [ + "Sponser name", + "Address", + "Mobile no", + "Status", + "Created At", + ]; + + const handleUpdateStatus = (id) => { + console.log(`Status updated for id: ${id}`); + // Add your status update logic here + }; + + // ====================================================[Table Filter]================================================================ + const filteredData = sponser.filter((item) => { + // Filter by name (case insensitive) + const name = item.sponserName; + const searchLower = searchTerm.toLowerCase(); + const nameMatches = name.toLowerCase().includes(searchLower); + + // Filter by status + // const status = item.status; + // const statusLower = status ? "active" : "inactive"; + + // const statusMatches = + // statusFilter === "all" || + // (statusFilter === "active" && status === true) || + // (statusFilter === "inactive" && status === false); + + return nameMatches; + }); + + const extractedArray = filteredData?.map((item) => ({ + "Sponser name": ( + + {item.sponserName} + + ), + Address: ( + + + {item.sponserAddress} + + + ), + "Mobile no": ( + + + {item.mobileNo} + + + ), + Status: + // handleUpdateStatus(item.id)} + // isChecked={item.status} + // /> + + item?.status ? ( + + Passed + + ) : ( + + Not passes + + ), + "Created At": ( + + + {formatDate(item.createdAt)} + + + + + + + + + Edit + + + View + + { + setActionId(item?.id); + setDeleteAlert(true); + }} + className="web-text-medium" + > + Delete + + + + + + ), + })); + + const handleDelete = () => { + const updatedSponsors = sponser.filter( + (sponsor) => sponsor.id !== actionId + ); + + setTimeout(() => { + setSponser(updatedSponsors); + setDeleteAlert(false); + setIsLoading(false); + }, 100); + setIsLoading(true); + }; + + return ( + + + + setSearchTerm(e.target.value)} + /> + + + + + + + + + + + + + + setDeleteAlert(false)} + isOpen={deleteAlert} + message={"Are you sure you want to delete sponers?"} + alertHandler={handleDelete} + isLoading={isLoading} + /> + + ); +}; + +export default ExchangeRate; diff --git a/src/Pages/Master/InvestmentType/InvestmentType.jsx b/src/Pages/Master/InvestmentType/InvestmentType.jsx new file mode 100644 index 0000000..d1343d2 --- /dev/null +++ b/src/Pages/Master/InvestmentType/InvestmentType.jsx @@ -0,0 +1,12 @@ +import { Box, Text } from "@chakra-ui/react"; +import { OPACITY_ON_LOAD } from "../../../Layout/animations"; + +const InvestmentType = () => { + return ( + + Investment type page + + ); +}; + +export default InvestmentType; diff --git a/src/Pages/WithDrawal/PendingRequest.jsx b/src/Pages/WithDrawal/PendingRequest.jsx new file mode 100644 index 0000000..d973223 --- /dev/null +++ b/src/Pages/WithDrawal/PendingRequest.jsx @@ -0,0 +1,12 @@ +import { Box, Text } from "@chakra-ui/react"; +import { OPACITY_ON_LOAD } from "../../Layout/animations"; + +const PendingRequest = () => { + return ( + + Pending Request Page + + ); +}; + +export default PendingRequest; diff --git a/src/Pages/WithDrawal/ViewHistory.jsx b/src/Pages/WithDrawal/ViewHistory.jsx new file mode 100644 index 0000000..6d74d4e --- /dev/null +++ b/src/Pages/WithDrawal/ViewHistory.jsx @@ -0,0 +1,12 @@ +import { Box, Text } from "@chakra-ui/react"; +import { OPACITY_ON_LOAD } from "../../Layout/animations"; + +const ViewHistory = () => { + return ( + + View History Page + + ); +}; + +export default ViewHistory; diff --git a/src/Routes/Nav.js b/src/Routes/Nav.js index 3ad95d2..f9bbe42 100644 --- a/src/Routes/Nav.js +++ b/src/Routes/Nav.js @@ -30,7 +30,7 @@ export const nav = [ { title: "Sponser Master", path: "/sponser", - icon:RiMoneyDollarBoxLine + icon: RiMoneyDollarBoxLine }, { title: "Investment Type", @@ -39,8 +39,8 @@ export const nav = [ }, { title: "Exchange Rate", - path: "/view", - icon:RiExchangeBoxLine + path: "/exchange-rate", + icon: RiExchangeBoxLine }, ], type: "accordion", @@ -51,13 +51,13 @@ export const nav = [ submenu: [ { title: "Create IO", - path: "/Create IO", - icon:MdOutlineAddChart + path: "/create", + icon: MdOutlineAddChart }, { title: "View IO", - path: "/View IO", - icon:HiOutlineChartSquareBar + path: "/view", + icon: HiOutlineChartSquareBar }, ], type: "accordion", @@ -68,13 +68,13 @@ export const nav = [ submenu: [ { title: "Investor Details", - path: "/Investor Details", - icon:TbListDetails + path: "/investor-details", + icon: TbListDetails }, { title: "Investor Transactions", - path: "/Investor Transactions", - icon:TbTransactionDollar + path: "/investor-transactions", + icon: TbTransactionDollar }, ], type: "accordion", @@ -88,13 +88,13 @@ export const nav = [ submenu: [ { title: "Pending Request", - path: "/Pending Request", - icon:VscGitPullRequestGoToChanges + path: "/pending-request", + icon: RiMoneyDollarBoxLine }, { title: "View History", - path: "/View History", - icon:TbChartHistogram + path: "/view-history", + icon: RiExchangeBoxLine } ], type: "accordion", @@ -105,13 +105,13 @@ export const nav = [ submenu: [ { title: "Pending Request", - path: "/Pending Request", - icon:VscGitPullRequestGoToChanges + path: "/investor-request", + icon: RiMoneyDollarBoxLine }, { title: "View History", - path: "/View History", - icon:TbChartHistogram + path: "/upgrade-history", + icon: RiExchangeBoxLine } ], type: "accordion", @@ -122,13 +122,13 @@ export const nav = [ submenu: [ { title: "Pending Request", - path: "/Pending Request", - icon:VscGitPullRequestGoToChanges + path: "/deletion-request", + icon: RiMoneyDollarBoxLine }, { title: "View History", - path: "/View History", - icon:TbChartHistogram + path: "/deletion-history", + icon: RiExchangeBoxLine } ], type: "accordion", @@ -137,38 +137,38 @@ export const nav = [ { title: "MANAGE ADMIN", type: "title", - },{ + }, { title: "Admin", submenu: [ { title: "Bank / Urban Investor", - path: "/Pending Request", - icon:TbReportMoney + path: "/bank-investor", + icon: TbReportMoney }, { title: "Academy", - path: "/Academy", - icon:GrManual + path: "/academy", + icon: SiAcademia }, { title: "Notification", - path: "/Notification", - icon:MdNotificationsNone + path: "/notification", + icon: MdNotificationsNone }, { title: "Contact Details", - path: "/Contact Details", - icon:LuContact + path: "/contact", + icon: LuContact }, { title: "Users", - path: "/Users", - icon:RiFileUserLine + path: "/users", + icon: RiFileUserLine }, { title: "Bank Details", - path: "/Bank Details", - icon:RiBankLine + path: "/bank-details", + icon: RiBankLine } ], type: "accordion", @@ -195,17 +195,17 @@ export const nestedNav = [ { title: "Sponser", path: "/sponser", - icon:RiMoneyDollarBoxLine + icon: RiMoneyDollarBoxLine }, { title: "Exchange rate", path: "/exchange-rate", - icon:RiExchangeBoxLine + icon: RiExchangeBoxLine }, { title: "Asset classes", path: "/view", - icon:VscSymbolClass + icon: VscSymbolClass }, ], type: "accordion", @@ -217,17 +217,17 @@ export const nestedNav = [ { title: "Sponser", path: "/loop", - icon:TbBrandMedium + icon: TbBrandMedium }, { title: "Class", path: "/class", - icon:TbBrandMedium + icon: TbBrandMedium }, { title: "View", path: "/view", - icon:TbBrandMedium + icon: TbBrandMedium }, ], type: "accordion", @@ -235,24 +235,23 @@ export const nestedNav = [ }, ] }, - , { title: "User", submenu: [ { title: "Sponser", path: "/loop", - icon:TbBrandMedium + icon: TbBrandMedium }, { title: "Class", path: "/class", - icon:TbBrandMedium + icon: TbBrandMedium }, { title: "View", path: "/view", - icon:TbBrandMedium + icon: TbBrandMedium }, ], type: "accordion", diff --git a/src/Routes/Routes.js b/src/Routes/Routes.js index 390c704..bf9b385 100644 --- a/src/Routes/Routes.js +++ b/src/Routes/Routes.js @@ -1,17 +1,58 @@ -import Investment from "../Pages/Investment/Investment"; +import DeletionHistory from "../Pages/AccountDeletion/DeletionHistory"; +import DeletionRequest from "../Pages/AccountDeletion/DeletionRequest"; +import Academy from "../Pages/Admin/Academy"; +import BankDetails from "../Pages/Admin/BankDetails"; +import BankInvestor from "../Pages/Admin/BankInvestor"; +import Contact from "../Pages/Admin/Contact"; +import Notification from "../Pages/Admin/Notification"; +import Users from "../Pages/Admin/Users"; +import Create from "../Pages/IO_Management/Create"; +import View from "../Pages/IO_Management/View"; +import InvestorPendingRequest from "../Pages/InvestorUpgrade/InvestorPendingRequest"; +import upgradeHistory from "../Pages/InvestorUpgrade/UpgradeHistory"; +import InvestorDetails from "../Pages/Investor_Management/InvestorDetails"; +import InvestorTransactions from "../Pages/Investor_Management/InvestorTransactions"; import ExchangeRate from "../Pages/Master/ExchangeRate/ExchangeRate"; +import InvestmentType from "../Pages/Master/InvestmentType/InvestmentType"; import AddSponser from "../Pages/Master/Sponser/AddSponser"; import Sponser from "../Pages/Master/Sponser/Sponsers"; -import UnderConstruction from "../Pages/UnderConstruction"; +import PendingRequest from "../Pages/WithDrawal/PendingRequest"; +import ViewHistory from "../Pages/WithDrawal/ViewHistory"; export const RouteLink = [ // =============[ Tanami ]================ + // ===============[ Management]=============== { path: "/sponser", Component: Sponser }, { path: "/sponser/add-sponser", Component: AddSponser }, + { path: "/exchange-rate", Component: ExchangeRate }, + { path: "/investment-type", Component: InvestmentType }, + // ===============[ IO Management]=============== + { path: "/create", Component: Create }, + { path: "/view", Component: View }, + // ===============[ Investor Management]=============== + { path: "/investor-details", Component: InvestorDetails }, + { path: "/investor-transactions", Component: InvestorTransactions }, - - { path: "/exchange-rate", Component: UnderConstruction }, + // ===============[ Withdrawal]=============== + { path: "/pending-request", Component: PendingRequest }, + { path: "/view-history", Component: ViewHistory }, + + // ===============[ Withdrawal]=============== + { path: "/upgrade-history", Component: upgradeHistory }, + { path: "/investor-request", Component: InvestorPendingRequest }, + + // ===============[ Deletion]=============== + { path: "/deletion-request", Component: DeletionRequest }, + { path: "/deletion-history", Component: DeletionHistory }, + + // ===============[ Admin]=============== + { path: "/bank-investor", Component: BankInvestor }, + { path: "/academy", Component: Academy }, + { path: "/notification", Component: Notification }, + { path: "/contact", Component: Contact }, + { path: "/users", Component: Users }, + { path: "/bank-details", Component: BankDetails }, ]; diff --git a/src/Validations/Validations.js b/src/Validations/Validations.js index 4500474..180cd7d 100644 --- a/src/Validations/Validations.js +++ b/src/Validations/Validations.js @@ -795,3 +795,17 @@ export const addFaq = Yup.object().shape({ // } // }) }); + + +// Tanami Schema + +export const investmentSchema = Yup.object().shape({ + name: Yup.string().required("Name is required"), + address: Yup.string().required("Type is required"), + mobile: Yup.string().required("Total Fund is required"), + bankDetails: Yup.string().required("Total Investor is required"), + bankAccount: Yup.string().required("Predicted Income is required"), + status: Yup.string() + .oneOf(["available", "upcoming", "closed"], "Invalid status") + .required("Status is required"), +}); \ No newline at end of file