diff --git a/new-lamassu-admin/src/pages/Customers/components/PhotosCard.js b/new-lamassu-admin/src/pages/Customers/components/PhotosCard.js
index 0181fdca..d3c56133 100644
--- a/new-lamassu-admin/src/pages/Customers/components/PhotosCard.js
+++ b/new-lamassu-admin/src/pages/Customers/components/PhotosCard.js
@@ -14,12 +14,17 @@ import PhotosCarousel from './PhotosCarousel'
const useStyles = makeStyles(styles)
-const PhotosCard = memo(({ photosData }) => {
+const PhotosCard = memo(({ photosData, timezone }) => {
const classes = useStyles()
const [photosDialog, setPhotosDialog] = useState(false)
- const singlePhoto = R.head(photosData)
+ const sortedPhotosData = R.sortWith(
+ [(a, b) => R.has('id', a) - R.has('id', b), R.descend(R.prop('date'))],
+ photosData
+ )
+
+ const singlePhoto = R.head(sortedPhotosData)
return (
<>
@@ -39,7 +44,7 @@ const PhotosCard = memo(({ photosData }) => {
/>
- {photosData.length}
+ {sortedPhotosData.length}
@@ -51,7 +56,9 @@ const PhotosCard = memo(({ photosData }) => {
From 18c92d25363a8420357ab7472601a3c7317ebc6b Mon Sep 17 00:00:00 2001
From: Nikola Ubavic <53820106+ubavic@users.noreply.github.com>
Date: Mon, 21 Feb 2022 12:58:42 +0100
Subject: [PATCH 2/3] fix: add bottom margin to right side panel
fix: date break in transactions list
---
.../src/pages/Customers/CustomerProfile.styles.js | 3 ++-
.../src/pages/Customers/components/TransactionsList.js | 2 +-
2 files changed, 3 insertions(+), 2 deletions(-)
diff --git a/new-lamassu-admin/src/pages/Customers/CustomerProfile.styles.js b/new-lamassu-admin/src/pages/Customers/CustomerProfile.styles.js
index a486abee..4fa08597 100644
--- a/new-lamassu-admin/src/pages/Customers/CustomerProfile.styles.js
+++ b/new-lamassu-admin/src/pages/Customers/CustomerProfile.styles.js
@@ -31,7 +31,8 @@ export default {
},
rightSidePanel: {
display: 'block',
- width: 1100
+ width: 1100,
+ marginBottom: 25
},
leftSidePanel: {
width: 300,
diff --git a/new-lamassu-admin/src/pages/Customers/components/TransactionsList.js b/new-lamassu-admin/src/pages/Customers/components/TransactionsList.js
index ea8d765e..881da134 100644
--- a/new-lamassu-admin/src/pages/Customers/components/TransactionsList.js
+++ b/new-lamassu-admin/src/pages/Customers/components/TransactionsList.js
@@ -120,7 +120,7 @@ const TransactionsList = ({ customer, data, loading, locale }) => {
{
header: 'Date',
width: 100,
- view: it => formatDate(it.created, timezone, 'yyyy-MM-dd')
+ view: it => formatDate(it.created, timezone, 'yyyy‑MM‑dd')
},
{
header: 'Time (h:m:s)',
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 3/3] 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 }) => {
)}