Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,10 @@
<img src="https://img.shields.io/badge/PRs-welcome-brightgreen.svg" alt="PRs welcome!" />
</a>
<a href="https://github.com/opexdev/OPEX-Admin-Panel">
<img src="https://img.shields.io/github/last-commit/opexdev/OPEX-Admin-Panel" alt="Last commit">
<img src="https://img.shields.io/github/last-commit/opexdev/admin-panel" alt="Last commit">
</a>
<a href="https://github.com/opexdev/OPEX-Web-APP/issues" target="blank">
<img src="https://img.shields.io/github/issues/opexdev/OPEX-Admin-Panel" alt="github-profile-readme-generator issues"/>
<img src="https://img.shields.io/github/issues/opexdev/admin-panel" alt="github-profile-readme-generator issues"/>
</a>
</p>

Expand Down
155 changes: 82 additions & 73 deletions src/components/KycUsers/KycUsers.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import usePagination from "../../hooks/usePagination";
import {users as userRoute} from "../../routes/routes";
import Loading from "../Loading";
import {toast} from "react-hot-toast";
import ScrollBar from "../ScrollBar";

const KycUsers = () => {
const axiosPrivate = useAxiosPrivate();
Expand Down Expand Up @@ -45,7 +46,6 @@ const KycUsers = () => {
}, [status])



const impersonateLogin = async (user) => {
const params =
{
Expand All @@ -62,93 +62,102 @@ const KycUsers = () => {
}

return <div className="col-12 d-flex flex-column justify-content-between align-items-center px-5 py-5">
<div className="d-flex justify-content-center align-items-center" style={{height:"12%" , width:"100%"}} onChange={(e) => setStatus(e.target.value)}>
<div className="d-flex justify-content-center align-items-center" style={{height: "12%", width: "100%"}}
onChange={(e) => setStatus(e.target.value)}>

<div className="form-check form-check-inline">
<input className="form-check-input primary-bg" type="radio" name="status" value="kyc-requested"
defaultChecked={status === "kyc-requested"} id="kyc-requested"/>
<label className="form-check-label" htmlFor="kyc-requested">Requested</label>
</div>
<div className="form-check form-check-inline">
<input className="form-check-input primary-bg" type="radio" name="status" value="kyc-requested"
defaultChecked={status === "kyc-requested"} id="kyc-requested"/>
<label className="form-check-label" htmlFor="kyc-requested">Requested</label>
</div>

<div className="form-check form-check-inline">
<input className="form-check-input primary-bg" type="radio" name="status" value="kyc-accepted"
defaultChecked={status === "kyc-accepted"} id="kyc-accepted"/>
<label className="form-check-label" htmlFor="kyc-accepted">Accepted</label>
</div>
<div className="form-check form-check-inline">
<input className="form-check-input primary-bg" type="radio" name="status" value="kyc-accepted"
defaultChecked={status === "kyc-accepted"} id="kyc-accepted"/>
<label className="form-check-label" htmlFor="kyc-accepted">Accepted</label>
</div>

<div className="form-check form-check-inline">
<input className="form-check-input primary-bg" type="radio" name="status" value="kyc-rejected"
defaultChecked={status === "kyc-rejected"} id="kyc-rejected"/>
<label className="form-check-label" htmlFor="kyc-rejected">Rejected</label>
</div>
<div className="form-check form-check-inline">
<input className="form-check-input primary-bg" type="radio" name="status" value="kyc-rejected"
defaultChecked={status === "kyc-rejected"} id="kyc-rejected"/>
<label className="form-check-label" htmlFor="kyc-rejected">Rejected</label>
</div>


<div className="form-check form-check-inline">
<input className="form-check-input primary-bg" type="radio" name="status" value="kyc-blocked"
defaultChecked={status === "kyc-blocked"} id="kyc-blocked"/>
<label className="form-check-label" htmlFor="kyc-blocked">Blocked</label>
</div>
<div className="form-check form-check-inline">
<input className="form-check-input primary-bg" type="radio" name="status" value="kyc-blocked"
defaultChecked={status === "kyc-blocked"} id="kyc-blocked"/>
<label className="form-check-label" htmlFor="kyc-blocked">Blocked</label>
</div>

</div>
<div className="d-flex flex-column justify-content-between align-items-center" style={{height:"88%", width:"100%"}}>
<table className="table table-bordered rounded text-center col-12 striped">
<thead className="py-2 my-2" style={{paddingBottom: "1vh !important"}}>
<tr>
<th scope="col"></th>
<th scope="col">First Name</th>
<th scope="col">Last Name</th>
<th scope="col">Email</th>
<th scope="col">ID</th>
<th scope="col">Enable</th>
<th scope="col">Email Verified</th>
<th scope="col">Login as user</th>
<th scope="col">Detail</th>
</tr>
</thead>
<tbody>
{
isLoading ?
<tr>
<td colSpan="12" className="text-center py-5" style={{height:"50vh"}}>
<Loading/>
</td>
</tr>
: users?.users?.length === 0 ?
<tr><td colSpan="12" className="text-center" style={{height:"50vh"}}>No User Exist</td></tr>:
users?.users?.map((user, index) => <tr key={user.id}>
<th scope="row">{index + 1}</th>
<td>{user.firstName}</td>
<td>{user.lastName}</td>
<td>{user.email}</td>
<td>{user.id}</td>
<td>
<img className="table-img"
src={user.isEnabled ? toAbsoluteUrl("media/img/check.svg") : toAbsoluteUrl("media/img/remove.svg")}
alt=""/></td>
<td>
<img className="table-img"
src={user.isEmailVerified ? toAbsoluteUrl("media/img/check.svg") : toAbsoluteUrl("media/img/remove.svg")}
alt=""/></td>
<td>
<img className="table-img pointer" onClick={() => impersonateLogin(user.id)}
src={toAbsoluteUrl("media/img/double-arrow.svg")} alt=""/></td>
<td>
<Link to={"/"+userRoute+"/"+user.id}>
<img className="table-img pointer" src={toAbsoluteUrl("media/img/info.svg")} alt=""/>
</Link>
<div className="d-flex flex-column justify-content-between align-items-center"
style={{height: "88%", width: "100%"}}>
<ScrollBar>
<table className="table table-bordered rounded text-center col-12 striped">
<thead className="py-2 my-2" style={{paddingBottom: "1vh !important"}}>
<tr>
<th scope="col"></th>
<th scope="col">First Name</th>
<th scope="col">Last Name</th>
<th scope="col">Email</th>
<th scope="col">ID</th>
<th scope="col">Enable</th>
<th scope="col">Email Verified</th>
<th scope="col">Login as user</th>
<th scope="col">Detail</th>
</tr>
</thead>
<tbody>
{
isLoading ?
<tr>
<td colSpan="12" className="text-center py-5" style={{height: "50vh"}}>
<Loading/>
</td>
</tr>)
}
</tbody>
</table>
</tr>
: users?.users?.length === 0 ?
<tr>
<td colSpan="12" className="text-center" style={{height: "50vh"}}>No User Exist</td>
</tr> :
users?.users?.map((user, index) => <tr key={user.id}>
<th scope="row">{index + 1}</th>
<td>{user.firstName}</td>
<td>{user.lastName}</td>
<td>{user.email}</td>
<td>{user.id}</td>
<td>
<img className="table-img"
src={user.isEnabled ? toAbsoluteUrl("media/img/check.svg") : toAbsoluteUrl("media/img/remove.svg")}
alt=""/></td>
<td>
<img className="table-img"
src={user.isEmailVerified ? toAbsoluteUrl("media/img/check.svg") : toAbsoluteUrl("media/img/remove.svg")}
alt=""/></td>
<td>
<img className="table-img pointer" onClick={() => impersonateLogin(user.id)}
src={toAbsoluteUrl("media/img/double-arrow.svg")} alt=""/></td>
<td>
<Link to={"/" + userRoute + "/" + user.id}>
<img className="table-img pointer" src={toAbsoluteUrl("media/img/info.svg")}
alt=""/>
</Link>
</td>
</tr>)
}
</tbody>
</table>
</ScrollBar>
{error ?
<div className="alert alert-danger" role="alert">
<i className="fa fa-exclamation-triangle mx-2" aria-hidden="true"/>
{error.toString()}
</div>
: ""
}
<Pagination maxPage={maxPage} paginate={paginate}/>
<div className="mt-5">
<Pagination maxPage={maxPage} paginate={paginate}/>
</div>
</div>
</div>
}
Expand Down
2 changes: 1 addition & 1 deletion src/components/Users/UserInfo.js
Original file line number Diff line number Diff line change
Expand Up @@ -227,7 +227,7 @@ const UserInfo = () => {
{
!isLoading ? <UserStatus id={user.id} initialState={user?.groups[0]?.name}>

{ !user?.attributes && <div className="text-danger secondary-bg card text-center py-5">This user has not entered any information</div> }
{ !user?.attributes && <div className="text-danger text-center py-5">User has no information</div> }

</UserStatus>
:""
Expand Down
62 changes: 34 additions & 28 deletions src/components/Users/Users.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import {toast} from "react-hot-toast";
import Pagination from "../Pagination/Pagination";
import usePagination from "../../hooks/usePagination";
import Loading from "../Loading";
import ScrollBar from "../ScrollBar";

const Users = () => {
const [error, setError] = useState();
Expand Down Expand Up @@ -61,10 +62,11 @@ const Users = () => {
}

return <div className="col-12 d-flex flex-column justify-content-between align-items-center px-5 py-5">
<ScrollBar>
<table className="table table-bordered rounded text-center col-12 striped">
<thead className="py-2 my-2" style={{paddingBottom: "1vh !important"}}>
<tr className="">
<th scope="col my-1" style={{width:"4%"}}></th>
<th scope="col my-1" style={{width: "4%"}}></th>
<th scope="col">First Name</th>
<th scope="col">Last Name</th>
<th scope="col">Email</th>
Expand All @@ -79,48 +81,52 @@ const Users = () => {
{
isLoading ?
<tr>
<td colSpan="12" className="text-center py-5" style={{height:"50vh"}}>
<td colSpan="12" className="text-center py-5" style={{height: "50vh"}}>
<Loading/>
</td>
</tr>
: users?.users?.length === 0 ?
<tr><td colSpan="12" className="text-center" style={{height:"50vh"}}>No User Exist</td></tr>:
users?.users.map((user, index) => <tr key={user.id}>
<th scope="row">{(paginate.page - 1) * paginate.perPage + index + 1}</th>
<td>{user.firstName}</td>
<td>{user.lastName}</td>
<td>{user.email}</td>
<td>{user.id}</td>
<td>
<img className="table-img"
src={user.isEnabled ? toAbsoluteUrl("media/img/check.svg") : toAbsoluteUrl("media/img/remove.svg")}
alt=""/></td>
<td>
<img className="table-img"
src={user.isEmailVerified ? toAbsoluteUrl("media/img/check.svg") : toAbsoluteUrl("media/img/remove.svg")}
alt=""/></td>
<td>
<img className="table-img pointer" onClick={() => impersonateLogin(user.id)}
src={toAbsoluteUrl("media/img/double-arrow.svg")} alt=""/></td>
<td>
<Link to={user.id}>
<img className="table-img pointer" src={toAbsoluteUrl("media/img/info.svg")}
alt=""/>
</Link>
</td>
</tr>)
<tr>
<td colSpan="12" className="text-center" style={{height: "50vh"}}>No User Exist</td>
</tr> :
users?.users.map((user, index) => <tr key={user.id}>
<th scope="row">{(paginate.page - 1) * paginate.perPage + index + 1}</th>
<td>{user.firstName}</td>
<td>{user.lastName}</td>
<td>{user.email}</td>
<td>{user.id}</td>
<td>
<img className="table-img"
src={user.isEnabled ? toAbsoluteUrl("media/img/check.svg") : toAbsoluteUrl("media/img/remove.svg")}
alt=""/></td>
<td>
<img className="table-img"
src={user.isEmailVerified ? toAbsoluteUrl("media/img/check.svg") : toAbsoluteUrl("media/img/remove.svg")}
alt=""/></td>
<td>
<img className="table-img pointer" onClick={() => impersonateLogin(user.id)}
src={toAbsoluteUrl("media/img/double-arrow.svg")} alt=""/></td>
<td>
<Link to={user.id}>
<img className="table-img pointer" src={toAbsoluteUrl("media/img/info.svg")}
alt=""/>
</Link>
</td>
</tr>)
}
</tbody>
</table>
</ScrollBar>
{error ?
<div className="alert alert-danger" role="alert">
<i className="fa fa-exclamation-triangle mx-2" aria-hidden="true"/>
{error.toString()}
</div>
: ""
}
<div className="mt-5">
<Pagination maxPage={maxPage} paginate={paginate}/>

</div>
</div>
}

Expand Down
Loading