diff --git a/src/RouteLinks.js b/src/RouteLinks.js index ce8bbd8..525ed45 100644 --- a/src/RouteLinks.js +++ b/src/RouteLinks.js @@ -4,10 +4,11 @@ const RouteLinks = { customerPage: '/customer', subscriptions: '/subscriptions', billings: '/billings', - + recentSignup: '/recent', loansPage: '/loans', transactionsPage: '/transactions', offers: '/offers', + usersAdmin: '/users-admin', transaction_details_page: '/transaction/details', errorPage: '*', } diff --git a/src/SiteRoutes.jsx b/src/SiteRoutes.jsx index e9a0064..eb262fe 100644 --- a/src/SiteRoutes.jsx +++ b/src/SiteRoutes.jsx @@ -14,7 +14,9 @@ import BillingsPage from './pages/BillingsPage' // LOAN CHARGES PAGE import LoansPage from './pages/LoansPage' // SELECTED LOANS PAGE import TransactionDetailsPage from './pages/TransactionDetailsPage' // TRANSACTION DETAILS PAGE import OffersPage from './pages/OffersPage' // LOAN OFFERS PAGE -import ErrorPage from './pages/ErrorPage' // ERROR PAGE +import ErrorPage from './pages/ErrorPage'; + +import UsersAdminPage from "./pages/UsersAdminPage"; // ERROR PAGE // const Home = lazy(() => import('./pages/Home')); @@ -26,6 +28,7 @@ export default function SiteRoutes() { }> } /> {`*/HOME PAGE*/`} + } /> {`*/HOME PAGE*/`} } /> {`*/SUBSCRIPTIONS PAGE*/`} } /> {`*/CUSTOMER PAGE*/`} } /> {`*/BILLINGS PAGE*/`} @@ -33,6 +36,7 @@ export default function SiteRoutes() { } /> {`*/LOANS PAGE*/`} } /> {`*/TRANSACTION PAGE*/`} } /> {`*/LOAN OFFERS PAGE*/`} + } /> {/* ERROR PAGE */} diff --git a/src/components/layouts/aside/DashboardAside.jsx b/src/components/layouts/aside/DashboardAside.jsx index b616985..0d1f2f6 100644 --- a/src/components/layouts/aside/DashboardAside.jsx +++ b/src/components/layouts/aside/DashboardAside.jsx @@ -151,14 +151,14 @@ const asideNavLinks = [ {name: 'Dashboard', status: 1, icon: 'dashboard', to: RouteLinks.homePage}, { name: 'Deployments', title: 'Activities', status: 1, icon: 'arrow-right', subLinks: [ - {name: 'Active', status: 1, icon: 'dot', to: RouteLinks.transactionsPage}, + {name: 'Recent Signup', status: 1, icon: 'dot', to: RouteLinks.recentSignup}, {name: 'Provisions', status: 1, icon: 'dot', to: RouteLinks.subscriptions}, {name: 'Customers', status: 1, icon: 'dot', to: RouteLinks.customerPage}, {name: 'Billings', status: 1, icon: 'dot', to: RouteLinks.billings}, { name: 'Configurations', status: 1, icon: 'arrow-right', subLinks: [ {name: 'Product Settings', status: 1, icon: 'dot', to: RouteLinks.offers}, - {name: 'Admin Manager', status: 1, icon: 'dot', to: RouteLinks.offers}, + {name: 'Admin Manager', status: 1, icon: 'dot', to: RouteLinks.usersAdmin}, ] }, ], diff --git a/src/components/offers/OffersCom.jsx b/src/components/offers/OffersCom.jsx index 79d6a99..fcfa953 100644 --- a/src/components/offers/OffersCom.jsx +++ b/src/components/offers/OffersCom.jsx @@ -28,7 +28,7 @@ export default function OffersCom() { return (
- +
{isFetching ? diff --git a/src/components/users_admin/UsersAdmin.jsx b/src/components/users_admin/UsersAdmin.jsx new file mode 100644 index 0000000..dd85ca3 --- /dev/null +++ b/src/components/users_admin/UsersAdmin.jsx @@ -0,0 +1,135 @@ +import React, { useState } from 'react' +import { useQuery } from "@tanstack/react-query"; + +import BreadcrumbCom from '../breadcrumb/BreadcrumbCom' +import TablePaginatedWrapper from '../tableWrapper/TablePaginatedWrapper' +import Icons from '../Icons' + +import Avatar from '../../assets/user_avatar.jpg' +import queryKeys from '../../services/queryKeys' +import { getOffers } from '../../services/siteServices' +// import getDateFromDateString from '../../helpers/GetDateFromDateString'; +import formatNumber from '../../helpers/formatNumber'; + +export default function UsersAdmin() { + + const [page, setPage] = useState(1) + + const {data, isFetching, isError, error} = useQuery({ + queryKey: [...queryKeys.offers, page], + queryFn: () => getOffers({page}), + staleTime: 0, + // placeholderData: keepPreviousData, + }) + + const offers = data?.data?.offers // LOAN CHARGES LIST + const pagination = data?.data?.pagination + console.log('offers', offers) + + return ( +
+ + +
+ {isFetching ? + <> +

Loading...

+ + : isError ? +

{error.message}

+ : + + {({ data }) => ( + <> + + + + + + + + + + + + + + {(data && data.length > 0) ? data?.map((item, index) => ( + + + + + + + + + + )) + : + + + + } + +
+ Name + + Interest Rate + + Insurance Rate + + Mgt. Rate + + Max/Min Amount + + Tenor + + Action +
+
+ Jese +
+
{item?.product_id || ''}
+ {/*
{item?.description}
*/} +
+
+
+
+
{formatNumber(item?.interest_rate)}
+
+
+
+
{formatNumber(item?.insurance_rate)}
+
+
+
+
{formatNumber(item?.management_rate)}
+
+
+
+
{formatNumber(item?.maximum_amount)}
+
{formatNumber(item?.minimum_amount)}
+
+
+
+
{item?.tenor}
+
+
+
+
+ +
+
+
+
+ No Record Found +
+
+ + )} +
+ } +
+
+ ) +} \ No newline at end of file diff --git a/src/pages/UsersAdminPage.jsx b/src/pages/UsersAdminPage.jsx new file mode 100644 index 0000000..ee454a7 --- /dev/null +++ b/src/pages/UsersAdminPage.jsx @@ -0,0 +1,8 @@ +import React from 'react' +import UsersAdmin from "../components/users_admin/UsersAdmin"; + +export default function UsersAdminPage() { + return ( + + ) +}