Showing revocation details

This commit is contained in:
sairaj mote 2023-03-28 23:51:08 +05:30
parent 1a1a3f1b8e
commit 82e2b0993e
4 changed files with 36 additions and 8 deletions

View File

@ -404,7 +404,7 @@ header {
#kyc_section,
#verification_section {
width: min(100%, 34rem);
width: min(100%, 40rem);
padding: max(1rem, 2vw);
margin: 0 auto;
border-radius: 0.5rem;
@ -439,6 +439,10 @@ header {
color: rgba(var(--text-color), 0.8);
gap: 0.3rem 1rem;
}
.info span:first-of-type {
font-weight: 500;
min-width: 5rem;
}
.error {
color: var(--danger-color);

2
css/main.min.css vendored

File diff suppressed because one or more lines are too long

View File

@ -384,7 +384,7 @@ header {
}
#kyc_section,
#verification_section {
width: min(100%, 34rem);
width: min(100%, 40rem);
padding: max(1rem, 2vw);
margin: 0 auto;
border-radius: 0.5rem;
@ -424,6 +424,10 @@ header {
font-size: 0.9rem;
color: rgba(var(--text-color), 0.8);
gap: 0.3rem 1rem;
span:first-of-type {
font-weight: 500;
min-width: 5rem;
}
}
.error {
color: var(--danger-color);

View File

@ -50,7 +50,7 @@
<theme-toggle></theme-toggle>
</header>
<section id="verification_section" class="grid gap-1-5">
<div class="grid gap-0-5">
<div class="grid gap-0-5 text-center justify-items-center">
<h2>KYC verification</h2>
<P>
Enter the address you want to verify
@ -174,10 +174,10 @@
if (address === '') return renderElem(getRef('verification_result'), html`Please enter an address`);
getRef('verification_result').classList.remove('hidden');
if (floGlobals.approvedKyc[address]) {
const { validFrom, validTo, verifiedBy } = floGlobals.approvedKyc[address];
const { validFrom, validTo, verifiedBy, revokedBy } = floGlobals.approvedKyc[address];
const validFromFormatted = getFormattedTime(validFrom, 'date-only');
const validToFormatted = getFormattedTime(validTo, 'date-only');
if (validFrom <= Date.now() && Date.now() <= validTo) {
const validFromFormatted = getFormattedTime(validFrom, 'date-only');
const validToFormatted = getFormattedTime(validTo, 'date-only');
getRef('verification_result').dataset.status = 'valid';
renderElem(getRef('verification_result'), html`
<div class="grid justify-items-center text-center gap-0-5" style="margin: 2rem">
@ -186,10 +186,14 @@
</div>
<div class="info flex align-center gap-0-5 flex-wrap">
<span>Verified on</span>
<span>${getFormattedTime(Date.now(), 'date-only')}</span>
</div>
<div class="info flex align-center gap-0-5 flex-wrap">
<span>Issued on</span>
<span>${validFromFormatted}</span>
</div>
<div class="info flex align-center gap-0-5 flex-wrap">
<span>Verified By</span>
<span>Issued by</span>
<sm-copy value=${verifiedBy} clip-text></sm-copy>
</div>
`);
@ -199,6 +203,22 @@
<svg class="icon" xmlns="http://www.w3.org/2000/svg" enable-background="new 0 0 24 24" height="24px" viewBox="0 0 24 24" width="24px" fill="#000000"><g><path d="M0,0h24v24H0V0z" fill="none"/></g><g><path d="M12,2L4,5v6.09c0,5.05,3.41,9.76,8,10.91c4.59-1.15,8-5.86,8-10.91V5L12,2z M15.5,14.09l-1.41,1.41L12,13.42L9.91,15.5 L8.5,14.09L10.59,12L8.5,9.91L9.91,8.5L12,10.59l2.09-2.09l1.41,1.41L13.42,12L15.5,14.09z"/></g></svg>
<h4>KYC verification expired</h4>
</div>
<div class="info flex align-center gap-0-5 flex-wrap">
<span>Issued on</span>
<span>${validFromFormatted}</span>
</div>
<div class="info flex align-center gap-0-5 flex-wrap">
<span>Issued by</span>
<sm-copy value=${verifiedBy} clip-text></sm-copy>
</div>
<div class="info flex align-center gap-0-5 flex-wrap">
<span>Expired on</span>
<span>${validToFormatted}</span>
</div>
<div class="info flex align-center gap-0-5 flex-wrap">
<span>Revoked by</span>
<sm-copy value=${revokedBy} clip-text></sm-copy>
</div>
`);
getRef('verification_result').dataset.status = 'invalid';
}