Skip to content

Commit

Permalink
Update vc fields
Browse files Browse the repository at this point in the history
  • Loading branch information
pstamatop committed Nov 19, 2024
1 parent 4f43eb2 commit 122fe8f
Showing 1 changed file with 14 additions and 3 deletions.
17 changes: 14 additions & 3 deletions src/components/Credentials/CredentialInfo.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import React, { useContext, useEffect, useState } from 'react';
import { BiSolidCategoryAlt, BiSolidUserCircle } from 'react-icons/bi';
import { AiFillCalendar } from 'react-icons/ai';
import { RiPassExpiredFill } from 'react-icons/ri';
import { RiPassExpiredFill, RiPassValidFill } from 'react-icons/ri';
import { MdTitle, MdGrade, MdOutlineNumbers } from 'react-icons/md';
import { GiLevelEndFlag } from 'react-icons/gi';
import { formatDate } from '../../functions/DateFormat';
Expand All @@ -14,6 +14,8 @@ const getFieldIcon = (fieldName) => {
return <BiSolidCategoryAlt size={25} className="inline mr-1" />;
case 'expdate':
return <RiPassExpiredFill size={25} className="inline mr-1" />;
case 'validFrom':
return <RiPassValidFill size={25} className="inline mr-1" />;
case 'dateOfBirth':
return <AiFillCalendar size={25} className="inline mr-1" />;
case 'id':
Expand Down Expand Up @@ -75,7 +77,12 @@ const CredentialInfo = ({ credential, mainClassName = "text-sm lg:text-base w-fu
<tbody className="divide-y-4 divide-transparent">
{parsedCredential && (
<>
{renderRow('expdate', 'Expiration', formatDate(new Date(parsedCredential?.exp * 1000).toISOString()), screenType)}
{parsedCredential?.iat && renderRow('validFrom', 'Valid From', formatDate(new Date(parsedCredential?.iat * 1000).toISOString()), screenType)}
{renderRow('validFrom', 'Valid From', formatDate(parsedCredential?.period_entitlement?.starting_date, 'date'), screenType)}
{parsedCredential?.expiry_date
? renderRow('expdate', 'Expiration', formatDate(parsedCredential?.expiry_date, 'date'), screenType)
: renderRow('expdate', 'Expiration', formatDate(new Date(parsedCredential?.exp * 1000).toISOString()), screenType)
}
{renderRow('familyName', 'Family Name', parsedCredential?.family_name, screenType)}
{renderRow('firstName', 'Given Name', parsedCredential?.given_name, screenType)}
{renderRow('id', 'Personal ID', parsedCredential?.personal_identifier, screenType)}
Expand All @@ -85,7 +92,11 @@ const CredentialInfo = ({ credential, mainClassName = "text-sm lg:text-base w-fu
{renderRow('eqfLevel', 'EQF', parsedCredential?.eqf_level, screenType)}
{renderRow('grade', 'Grade', parsedCredential?.grade, screenType)}
{renderRow('id', 'Social Security Number', parsedCredential?.ssn, screenType)}
{renderRow('id', 'Document Number', parsedCredential?.document_number, screenType)}
{renderRow('id', 'Social Security Number', parsedCredential?.social_security_pin, screenType)}
{renderRow('id', 'Document ID', parsedCredential?.document_number, screenType)}
{renderRow('id', 'Document ID', parsedCredential?.ehic_card_identification_number, screenType)}
{renderRow('id', 'Document ID', parsedCredential?.pda1_document_id, screenType)}
{renderRow('id', 'Document ID', parsedCredential?.document_id, screenType)}
</>
)}
</tbody>
Expand Down

0 comments on commit 122fe8f

Please sign in to comment.