Compare commits
2 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 2a7c25d160 | |||
| 237be24476 |
Binary file not shown.
|
After Width: | Height: | Size: 602 KiB |
@@ -7,6 +7,7 @@ const QUERIES = {
|
|||||||
APPROVED_LIST: 'approved-list',
|
APPROVED_LIST: 'approved-list',
|
||||||
REJECTED_LIST: 'rejected-list',
|
REJECTED_LIST: 'rejected-list',
|
||||||
CUSTOMERS_LIST: 'customers-list',
|
CUSTOMERS_LIST: 'customers-list',
|
||||||
|
ADMIN_USERS_LIST: 'admin-users-list',
|
||||||
EMPLOYERS_LIST: 'employers-list',
|
EMPLOYERS_LIST: 'employers-list',
|
||||||
SIGNATORY_LIST: 'signatory-list',
|
SIGNATORY_LIST: 'signatory-list',
|
||||||
}
|
}
|
||||||
|
|||||||
+6
-2
@@ -1,5 +1,5 @@
|
|||||||
import {Suspense} from 'react'
|
import {Suspense, useEffect} from 'react'
|
||||||
import {Outlet} from 'react-router-dom'
|
import {Outlet, useLocation} from 'react-router-dom'
|
||||||
import {I18nProvider} from '../_digifi/i18n/i18nProvider'
|
import {I18nProvider} from '../_digifi/i18n/i18nProvider'
|
||||||
import {LayoutProvider, LayoutSplashScreen} from '../_digifi/layout/core'
|
import {LayoutProvider, LayoutSplashScreen} from '../_digifi/layout/core'
|
||||||
import {MasterInit} from '../_digifi/layout/MasterInit'
|
import {MasterInit} from '../_digifi/layout/MasterInit'
|
||||||
@@ -8,6 +8,10 @@ import {ThemeModeProvider} from '../_digifi/partials'
|
|||||||
import { CustomModalProvider } from '../context/CustomModal'
|
import { CustomModalProvider } from '../context/CustomModal'
|
||||||
|
|
||||||
const App = () => {
|
const App = () => {
|
||||||
|
const {pathname}= useLocation()
|
||||||
|
useEffect(()=>{
|
||||||
|
window.scrollTo(0,0)
|
||||||
|
},[pathname])
|
||||||
return (
|
return (
|
||||||
<Suspense fallback={<LayoutSplashScreen />}>
|
<Suspense fallback={<LayoutSplashScreen />}>
|
||||||
<I18nProvider>
|
<I18nProvider>
|
||||||
|
|||||||
@@ -11,7 +11,7 @@ import {
|
|||||||
stringifyRequestQuery,
|
stringifyRequestQuery,
|
||||||
WithChildren,
|
WithChildren,
|
||||||
} from '../../../../../../_digifi/helpers'
|
} from '../../../../../../_digifi/helpers'
|
||||||
import {getCustomerList} from './_requests'
|
import {getAdminUserList} from './_requests'
|
||||||
import {User} from './_models'
|
import {User} from './_models'
|
||||||
import {useQueryRequest} from './QueryRequestProvider'
|
import {useQueryRequest} from './QueryRequestProvider'
|
||||||
|
|
||||||
@@ -32,9 +32,9 @@ const QueryResponseProvider: FC<WithChildren> = ({children}) => {
|
|||||||
refetch,
|
refetch,
|
||||||
data: response,
|
data: response,
|
||||||
} = useQuery(
|
} = useQuery(
|
||||||
`${QUERIES.CUSTOMERS_LIST}-${query}`,
|
`${QUERIES.ADMIN_USERS_LIST}-${query}`,
|
||||||
() => {
|
() => {
|
||||||
return getCustomerList(query)
|
return getAdminUserList(query)
|
||||||
},
|
},
|
||||||
{cacheTime: 0, keepPreviousData: true, refetchOnWindowFocus: false}
|
{cacheTime: 0, keepPreviousData: true, refetchOnWindowFocus: false}
|
||||||
)
|
)
|
||||||
|
|||||||
@@ -30,6 +30,7 @@ export type User = {
|
|||||||
added?: string
|
added?: string
|
||||||
updated?: string
|
updated?: string
|
||||||
bvn?: string
|
bvn?: string
|
||||||
|
username?: string
|
||||||
}
|
}
|
||||||
|
|
||||||
export type UsersQueryResponse = Response<Array<User>>
|
export type UsersQueryResponse = Response<Array<User>>
|
||||||
|
|||||||
@@ -19,6 +19,12 @@ const getCustomerList = (query: string): Promise<UsersQueryResponse> => { // FUN
|
|||||||
.then((d: AxiosResponse<UsersQueryResponse>) => d.data);
|
.then((d: AxiosResponse<UsersQueryResponse>) => d.data);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
const getAdminUserList = (query: string): Promise<UsersQueryResponse> => { // FUNCTION TO GET USERS THAT HAVE STARTED LOAN APPLICATION
|
||||||
|
return axios
|
||||||
|
.get(`${NEW_USER_ENDPOINT}/users`)
|
||||||
|
.then((d: AxiosResponse<UsersQueryResponse>) => d.data);
|
||||||
|
};
|
||||||
|
|
||||||
const getUserById = (id: ID): Promise<User | undefined> => {
|
const getUserById = (id: ID): Promise<User | undefined> => {
|
||||||
return axios
|
return axios
|
||||||
.get(`${USER_URL}/${id}`)
|
.get(`${USER_URL}/${id}`)
|
||||||
@@ -54,6 +60,7 @@ export {
|
|||||||
deleteUser,
|
deleteUser,
|
||||||
deleteSelectedUsers,
|
deleteSelectedUsers,
|
||||||
getUserById,
|
getUserById,
|
||||||
|
getAdminUserList,
|
||||||
createUser,
|
createUser,
|
||||||
updateUser,
|
updateUser,
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -20,17 +20,6 @@ const usersColumns: ReadonlyArray<Column<User>> = [
|
|||||||
id: 'firstname',
|
id: 'firstname',
|
||||||
Cell: ({...props}) => <UserInfoCell user={props.data[props.row.index]} />,
|
Cell: ({...props}) => <UserInfoCell user={props.data[props.row.index]} />,
|
||||||
},
|
},
|
||||||
{
|
|
||||||
Header: (props) => <UserCustomHeader tableProps={props} title='BVN' className='min-w-125px' />,
|
|
||||||
accessor: 'bvn',
|
|
||||||
},
|
|
||||||
// {
|
|
||||||
// Header: (props) => (
|
|
||||||
// <UserCustomHeader tableProps={props} title='Payment Terms' className='min-w-125px' />
|
|
||||||
// ),
|
|
||||||
// id: 'payment_month',
|
|
||||||
// Cell: ({...props}) => <PaymentMonthCell payment_month={props.data[props.row.index].payment_month} />,
|
|
||||||
// },
|
|
||||||
{
|
{
|
||||||
Header: (props) => (
|
Header: (props) => (
|
||||||
<UserCustomHeader tableProps={props} title='Status' className='min-w-125px' />
|
<UserCustomHeader tableProps={props} title='Status' className='min-w-125px' />
|
||||||
|
|||||||
@@ -16,70 +16,39 @@ const AuthLayout = () => {
|
|||||||
}, []);
|
}, []);
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div className="d-flex flex-column flex-lg-row flex-column-fluid h-100">
|
<div className="d-flex flex-column flex-lg-row flex-column-fluid h-100vh"
|
||||||
|
style={{backgroundImage: 'url(../../../../public/media/auth/digifi_bko_home.jpg)', backgroundRepeat: 'none', backgroundSize: 'cover'}}
|
||||||
|
>
|
||||||
{/* begin::Body */}
|
{/* begin::Body */}
|
||||||
<div className="d-flex flex-column flex-lg-row-fluid w-lg-50 p-10 order-2 order-lg-1">
|
<div className="flex flex-column align-items-center w-lg-50 p-10">
|
||||||
{/* begin::Form */}
|
{/* begin::Form */}
|
||||||
<div className="d-flex flex-center flex-column flex-lg-row-fluid">
|
<div
|
||||||
|
// className="d-flex flex-center flex-column flex-lg-row-fluid"
|
||||||
|
className="d-flex h-100 align-items-center"
|
||||||
|
>
|
||||||
{/* begin::Wrapper */}
|
{/* begin::Wrapper */}
|
||||||
<div className="w-lg-500px p-10">
|
<div className="w-lg-500px p-10 bg-white shadow-sm">
|
||||||
|
{/* begin::Title */}
|
||||||
|
<h1 className="text-black fs-2qx fw-bolder text-center mb-7">
|
||||||
|
{/* begin::Logo */}
|
||||||
|
<Link to="/" className="mb-12">
|
||||||
|
<img
|
||||||
|
alt="Logo"
|
||||||
|
src={toAbsoluteUrl("media/logos/custom-1.png")}
|
||||||
|
className="h-75px"
|
||||||
|
/>
|
||||||
|
</Link>
|
||||||
|
{/* end::Logo */}
|
||||||
|
BackOffice
|
||||||
|
</h1>
|
||||||
|
{/* end::Title */}
|
||||||
<Outlet />
|
<Outlet />
|
||||||
</div>
|
</div>
|
||||||
{/* end::Wrapper */}
|
{/* end::Wrapper */}
|
||||||
</div>
|
</div>
|
||||||
{/* end::Form */}
|
{/* end::Form */}
|
||||||
|
|
||||||
{/* begin::Footer */}
|
|
||||||
<div className="d-flex flex-center flex-wrap px-5">
|
|
||||||
{/* begin::Links */}
|
|
||||||
<div className="d-flex fw-semibold text-primary fs-base">
|
|
||||||
<a href="#" className="px-5" target="_blank">
|
|
||||||
Terms
|
|
||||||
</a>
|
|
||||||
|
|
||||||
<a href="#" className="px-5" target="_blank">
|
|
||||||
Contact Us
|
|
||||||
</a>
|
|
||||||
</div>
|
|
||||||
{/* end::Links */}
|
|
||||||
</div>
|
|
||||||
{/* end::Footer */}
|
|
||||||
</div>
|
</div>
|
||||||
{/* end::Body */}
|
{/* end::Body */}
|
||||||
|
|
||||||
{/* begin::Aside */}
|
|
||||||
<div
|
|
||||||
className="d-flex flex-lg-row-fluid w-lg-50 bgi-size-cover bgi-position-center order-1 order-lg-2"
|
|
||||||
>
|
|
||||||
{/* begin::Content */}
|
|
||||||
<div className="d-flex flex-column flex-center py-15 px-5 px-md-15 w-100">
|
|
||||||
{/* begin::Logo */}
|
|
||||||
<Link to="/" className="mb-12">
|
|
||||||
<img
|
|
||||||
alt="Logo"
|
|
||||||
src={toAbsoluteUrl("media/logos/custom-1.png")}
|
|
||||||
className="h-75px"
|
|
||||||
/>
|
|
||||||
</Link>
|
|
||||||
{/* end::Logo */}
|
|
||||||
|
|
||||||
{/* begin::Image */}
|
|
||||||
<img
|
|
||||||
className="mx-auto w-275px w-md-50 w-xl-500px mb-10 mb-lg-20"
|
|
||||||
src={toAbsoluteUrl("media/misc/agents-auth-screens.png")}
|
|
||||||
alt=""
|
|
||||||
/>
|
|
||||||
{/* end::Image */}
|
|
||||||
|
|
||||||
{/* begin::Title */}
|
|
||||||
<h1 className="text-black fs-2qx fw-bolder text-center mb-7">
|
|
||||||
digiFi BackOffice
|
|
||||||
</h1>
|
|
||||||
{/* end::Title */}
|
|
||||||
</div>
|
|
||||||
{/* end::Content */}
|
|
||||||
</div>
|
|
||||||
{/* end::Aside */}
|
|
||||||
</div>
|
</div>
|
||||||
);
|
);
|
||||||
};
|
};
|
||||||
|
|||||||
Reference in New Issue
Block a user