From 122fe8f9fb7dc691b229b7097b71e37b7f81fea7 Mon Sep 17 00:00:00 2001 From: pstamatop Date: Tue, 19 Nov 2024 12:41:46 +0200 Subject: [PATCH] Update vc fields --- src/components/Credentials/CredentialInfo.js | 17 ++++++++++++++--- 1 file changed, 14 insertions(+), 3 deletions(-) diff --git a/src/components/Credentials/CredentialInfo.js b/src/components/Credentials/CredentialInfo.js index 98a62e67..4b14a165 100644 --- a/src/components/Credentials/CredentialInfo.js +++ b/src/components/Credentials/CredentialInfo.js @@ -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'; @@ -14,6 +14,8 @@ const getFieldIcon = (fieldName) => { return ; case 'expdate': return ; + case 'validFrom': + return ; case 'dateOfBirth': return ; case 'id': @@ -75,7 +77,12 @@ const CredentialInfo = ({ credential, mainClassName = "text-sm lg:text-base w-fu {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)} @@ -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)} )}