diff --git a/new-lamassu-admin/src/pages/Customers/CustomerPhotos.js b/new-lamassu-admin/src/pages/Customers/CustomerPhotos.js index 6bb8a19c..526da25d 100644 --- a/new-lamassu-admin/src/pages/Customers/CustomerPhotos.js +++ b/new-lamassu-admin/src/pages/Customers/CustomerPhotos.js @@ -13,7 +13,7 @@ import PhotosCarousel from './components/PhotosCarousel' const useStyles = makeStyles(styles) -const CustomerPhotos = ({ photosData }) => { +const CustomerPhotos = ({ photosData, timezone }) => { const classes = useStyles() const [photosDialog, setPhotosDialog] = useState(false) @@ -41,7 +41,9 @@ const CustomerPhotos = ({ photosData }) => { } + data={ + + } onDissmised={() => { setPhotosDialog(false) setPhotoClickIndex(null) @@ -71,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/CustomerPhotos.styles.js b/new-lamassu-admin/src/pages/Customers/CustomerPhotos.styles.js index a7fdffe4..93d8637f 100644 --- a/new-lamassu-admin/src/pages/Customers/CustomerPhotos.styles.js +++ b/new-lamassu-admin/src/pages/Customers/CustomerPhotos.styles.js @@ -11,7 +11,8 @@ const styles = { photosChipList: { display: 'flex', flexDirection: 'row', - flexWrap: 'wrap' + flexWrap: 'wrap', + gap: 14 }, image: { objectFit: 'cover', @@ -22,7 +23,7 @@ const styles = { borderTopRightRadius: 4 }, photoCardChip: { - margin: [[0, 16, 0, 0]] + cursor: 'pointer' }, footer: { display: 'flex', diff --git a/new-lamassu-admin/src/pages/Customers/CustomerProfile.js b/new-lamassu-admin/src/pages/Customers/CustomerProfile.js index 1d44c02c..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 @@ -607,6 +615,7 @@ const CustomerProfile = memo(() => { photosData={photosData} locale={locale} setShowCompliance={() => setShowCompliance(!showCompliance)} + timezone={timezone} />
@@ -646,7 +655,10 @@ const CustomerProfile = memo(() => { )} {isPhotos && (
- +
)}
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/CustomerDetails.js b/new-lamassu-admin/src/pages/Customers/components/CustomerDetails.js index 8aebf62f..a03728f4 100644 --- a/new-lamassu-admin/src/pages/Customers/components/CustomerDetails.js +++ b/new-lamassu-admin/src/pages/Customers/components/CustomerDetails.js @@ -12,7 +12,7 @@ import PhotosCard from './PhotosCard' const useStyles = makeStyles(mainStyles) -const CustomerDetails = memo(({ customer, photosData, locale }) => { +const CustomerDetails = memo(({ customer, photosData, locale, timezone }) => { const classes = useStyles() const idNumber = R.path(['idCardData', 'documentNumber'])(customer) @@ -44,7 +44,7 @@ const CustomerDetails = memo(({ customer, photosData, locale }) => { return ( - +
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 }) => { } + data={ + + } onDissmised={() => { setPhotosDialog(false) }} diff --git a/new-lamassu-admin/src/pages/Customers/components/PhotosCarousel.js b/new-lamassu-admin/src/pages/Customers/components/PhotosCarousel.js index e0d6f2e0..72635092 100644 --- a/new-lamassu-admin/src/pages/Customers/components/PhotosCarousel.js +++ b/new-lamassu-admin/src/pages/Customers/components/PhotosCarousel.js @@ -4,6 +4,7 @@ import React, { memo, useState } from 'react' import { Carousel } from 'src/components/Carousel' import { Label1 } from 'src/components/typography' +import { formatDate } from 'src/utils/timezones' import CopyToClipboard from '../../Transactions/CopyToClipboard' @@ -11,7 +12,7 @@ import styles from './PhotosCarousel.styles' const useStyles = makeStyles(styles) -const PhotosCarousel = memo(({ photosData }) => { +const PhotosCarousel = memo(({ photosData, timezone }) => { const classes = useStyles() const [currentIndex, setCurrentIndex] = useState(0) @@ -37,10 +38,19 @@ const PhotosCarousel = memo(({ photosData }) => { )}
-
- -
{photosData && photosData[currentIndex]?.date}
-
+ {photosData[currentIndex].date && ( + <> + +
+ {photosData && + formatDate( + photosData[currentIndex]?.date, + timezone, + 'yyyy-MM-dd HH:mm' + )} +
+ + )}
diff --git a/new-lamassu-admin/src/pages/Customers/components/TransactionsList.js b/new-lamassu-admin/src/pages/Customers/components/TransactionsList.js index b2f9e9e2..2ec6a13e 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)',