fix: format date in PhotoCarousel

fix: photo card chip gap and cursor

fix: sort photos in overview by date
This commit is contained in:
Nikola Ubavic 2022-02-17 17:32:10 +01:00
parent a7ee694169
commit e1d700cb39
6 changed files with 32 additions and 13 deletions

View file

@ -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)
@ -39,7 +40,14 @@ const PhotosCarousel = memo(({ photosData }) => {
<div>
<div>
<Label>Date</Label>
<div>{photosData && photosData[currentIndex]?.date}</div>
<div>
{photosData &&
formatDate(
photosData[currentIndex]?.date,
timezone,
'yyyy-MM-dd HH:mm'
)}
</div>
</div>
</div>
<div>