From f8ca83921cb6725c3dd525969d9ff903a218a216 Mon Sep 17 00:00:00 2001
From: Nikola Ubavic <53820106+ubavic@users.noreply.github.com>
Date: Mon, 21 Feb 2022 14:36:14 +0100
Subject: [PATCH] fix: add ID photo to Photos & files
---
.../src/pages/Customers/CustomerPhotos.js | 2 +-
.../src/pages/Customers/CustomerProfile.js | 13 +++++++++-
.../Customers/components/PhotosCarousel.js | 24 ++++++++++---------
3 files changed, 26 insertions(+), 13 deletions(-)
diff --git a/new-lamassu-admin/src/pages/Customers/CustomerPhotos.js b/new-lamassu-admin/src/pages/Customers/CustomerPhotos.js
index f9b45156..526da25d 100644
--- a/new-lamassu-admin/src/pages/Customers/CustomerPhotos.js
+++ b/new-lamassu-admin/src/pages/Customers/CustomerPhotos.js
@@ -73,7 +73,7 @@ export const PhotoCard = ({
- {format('yyyy-MM-dd', new Date(date))}
+ {date ? format('yyyy-MM-dd', new Date(date)) : 'ID card image'}
diff --git a/new-lamassu-admin/src/pages/Customers/CustomerProfile.js b/new-lamassu-admin/src/pages/Customers/CustomerProfile.js
index 6057c6db..ff1f183b 100644
--- a/new-lamassu-admin/src/pages/Customers/CustomerProfile.js
+++ b/new-lamassu-admin/src/pages/Customers/CustomerProfile.js
@@ -480,6 +480,14 @@ const CustomerProfile = memo(() => {
)
const photosData = formatPhotosData(R.append(frontCameraData, txPhotosData))
+ const IDphotoData = customerData.idCardPhotoPath
+ ? [
+ {
+ photoDir: 'id-card-photo',
+ path: customerData.idCardPhotoPath
+ }
+ ]
+ : []
const loading = customerLoading || configLoading
@@ -647,7 +655,10 @@ const CustomerProfile = memo(() => {
)}
{isPhotos && (
-
+
)}
diff --git a/new-lamassu-admin/src/pages/Customers/components/PhotosCarousel.js b/new-lamassu-admin/src/pages/Customers/components/PhotosCarousel.js
index 2e63dc69..72635092 100644
--- a/new-lamassu-admin/src/pages/Customers/components/PhotosCarousel.js
+++ b/new-lamassu-admin/src/pages/Customers/components/PhotosCarousel.js
@@ -38,17 +38,19 @@ const PhotosCarousel = memo(({ photosData, timezone }) => {
)}
-
-
-
- {photosData &&
- formatDate(
- photosData[currentIndex]?.date,
- timezone,
- 'yyyy-MM-dd HH:mm'
- )}
-
-
+ {photosData[currentIndex].date && (
+ <>
+
+
+ {photosData &&
+ formatDate(
+ photosData[currentIndex]?.date,
+ timezone,
+ 'yyyy-MM-dd HH:mm'
+ )}
+
+ >
+ )}