From 5f1e8c55ff0bc3264f10a495e2c62f6bab779dcf Mon Sep 17 00:00:00 2001 From: Daria Golova Date: Thu, 26 May 2022 12:29:12 +0300 Subject: [PATCH] fix validate prop --- src/pages/digitalId/ProfileId.jsx | 10 +- src/partials/digitalId/ProfileTableItem.jsx | 104 ++++++++------------ 2 files changed, 46 insertions(+), 68 deletions(-) diff --git a/src/pages/digitalId/ProfileId.jsx b/src/pages/digitalId/ProfileId.jsx index 5a06620..75103fe 100644 --- a/src/pages/digitalId/ProfileId.jsx +++ b/src/pages/digitalId/ProfileId.jsx @@ -4,6 +4,9 @@ import Sidebar from '../../partials/Sidebar'; import Header from '../../partials/Header'; import ProfileTableItem from '../../partials/digitalId/ProfileTableItem'; import ProfileIcon from '../../images/profile-icon.svg'; +import Avatar01 from '../../images/avatar-01.jpg'; +import Avatar02 from '../../images/avatar-02.jpg'; +import Avatar03 from '../../images/avatar-03.jpg'; function Profile () { const [sidebarOpen, setSidebarOpen] = useState(false); @@ -14,8 +17,8 @@ function Profile () { value: 'Passport', property: 'Document type', status: 'Progress', - transactions: '0x7234ABC342342352345', - validatedData: '7234ABC342342352345' + transactions: ['0x7234ABC342342352345', '0x5745DEF342342352345'], + avatars: [Avatar01, Avatar02, Avatar03] }; return ( @@ -47,13 +50,12 @@ function Profile () { property={data.property} status={data.status} transactions={data.transactions} - validatedData={data.validatedData} + avatars={data.avatars} /> - ) diff --git a/src/partials/digitalId/ProfileTableItem.jsx b/src/partials/digitalId/ProfileTableItem.jsx index d00669d..5a17432 100644 --- a/src/partials/digitalId/ProfileTableItem.jsx +++ b/src/partials/digitalId/ProfileTableItem.jsx @@ -1,7 +1,4 @@ import React, { useState } from 'react'; -import Avatar01 from '../../images/avatar-01.jpg'; -import Avatar02 from '../../images/avatar-02.jpg'; -import Avatar03 from '../../images/avatar-03.jpg'; function ProfileTableItem(props) { const [descriptionOpen, setDescriptionOpen] = useState(false); @@ -9,7 +6,7 @@ function ProfileTableItem(props) { return ( <> - +
- +
{(props.status === 'Progress') ? (
@@ -51,9 +48,11 @@ function ProfileTableItem(props) {
- Avatar - Avatar - Avatar + {(props.avatars) ? ( + props.avatars.map((avatar, index) => ( + Avatar + )) + ): null}
- {/* Menu button */} + {/* Button */}
- +