fix: add ID photo to Photos & files

This commit is contained in:
Nikola Ubavic 2022-02-21 14:36:14 +01:00
parent 18c92d2536
commit f8ca83921c
3 changed files with 26 additions and 13 deletions

View file

@ -73,7 +73,7 @@ export const PhotoCard = ({
<div className={classes.footer}> <div className={classes.footer}>
<CameraIcon /> <CameraIcon />
<Label2 className={classes.date}> <Label2 className={classes.date}>
{format('yyyy-MM-dd', new Date(date))} {date ? format('yyyy-MM-dd', new Date(date)) : 'ID card image'}
</Label2> </Label2>
</div> </div>
</Paper> </Paper>

View file

@ -480,6 +480,14 @@ const CustomerProfile = memo(() => {
) )
const photosData = formatPhotosData(R.append(frontCameraData, txPhotosData)) const photosData = formatPhotosData(R.append(frontCameraData, txPhotosData))
const IDphotoData = customerData.idCardPhotoPath
? [
{
photoDir: 'id-card-photo',
path: customerData.idCardPhotoPath
}
]
: []
const loading = customerLoading || configLoading const loading = customerLoading || configLoading
@ -647,7 +655,10 @@ const CustomerProfile = memo(() => {
)} )}
{isPhotos && ( {isPhotos && (
<div> <div>
<CustomerPhotos photosData={photosData} timezone={timezone} /> <CustomerPhotos
photosData={R.concat(photosData, IDphotoData)}
timezone={timezone}
/>
</div> </div>
)} )}
</div> </div>

View file

@ -38,7 +38,8 @@ const PhotosCarousel = memo(({ photosData, timezone }) => {
)} )}
<div className={classes.secondRow}> <div className={classes.secondRow}>
<div> <div>
<div> {photosData[currentIndex].date && (
<>
<Label>Date</Label> <Label>Date</Label>
<div> <div>
{photosData && {photosData &&
@ -48,7 +49,8 @@ const PhotosCarousel = memo(({ photosData, timezone }) => {
'yyyy-MM-dd HH:mm' 'yyyy-MM-dd HH:mm'
)} )}
</div> </div>
</div> </>
)}
</div> </div>
<div> <div>
<Label>Taken by</Label> <Label>Taken by</Label>