feat: photo roll dialog
This commit is contained in:
parent
5dc82af9ad
commit
4f7960a59c
3 changed files with 44 additions and 30 deletions
|
|
@ -2,32 +2,19 @@ import { Dialog, DialogContent, makeStyles } from '@material-ui/core'
|
||||||
import React, { memo } from 'react'
|
import React, { memo } from 'react'
|
||||||
|
|
||||||
import { IconButton } from 'src/components/buttons'
|
import { IconButton } from 'src/components/buttons'
|
||||||
import { H4, P } from 'src/components/typography'
|
import { H2 } from 'src/components/typography'
|
||||||
import { ReactComponent as CloseIcon } from 'src/styling/icons/action/close/zodiac.svg'
|
import { ReactComponent as CloseIcon } from 'src/styling/icons/action/close/zodiac.svg'
|
||||||
import { spacer } from 'src/styling/variables'
|
import { spacer } from 'src/styling/variables'
|
||||||
|
|
||||||
const useStyles = makeStyles({
|
const useStyles = makeStyles({
|
||||||
dialogContent: {
|
closeButton: {
|
||||||
width: 434,
|
|
||||||
padding: spacer * 2,
|
|
||||||
paddingRight: spacer * 3.5
|
|
||||||
},
|
|
||||||
dialogTitle: {
|
|
||||||
padding: spacer * 2,
|
|
||||||
paddingRight: spacer * 1.5,
|
|
||||||
display: 'flex',
|
display: 'flex',
|
||||||
'justify-content': 'space-between',
|
padding: [[spacer * 2, spacer * 2, 0, spacer * 2]],
|
||||||
'& > h4': {
|
paddingRight: spacer * 1.5,
|
||||||
margin: 0
|
justifyContent: 'end'
|
||||||
},
|
|
||||||
'& > button': {
|
|
||||||
padding: 0,
|
|
||||||
marginTop: -(spacer / 2)
|
|
||||||
}
|
|
||||||
},
|
},
|
||||||
dialogActions: {
|
title: {
|
||||||
padding: spacer * 4,
|
margin: [[0, spacer * 2, spacer * 2, spacer * 2]]
|
||||||
paddingTop: spacer * 2
|
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|
||||||
|
|
@ -54,13 +41,18 @@ export const InformativeDialog = memo(
|
||||||
}
|
}
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<Dialog open={open} aria-labelledby="form-dialog-title" {...props}>
|
<Dialog
|
||||||
<DialogTitle id="customized-dialog-title" onClose={innerOnClose}>
|
fullWidth
|
||||||
<H4>{title}</H4>
|
open={open}
|
||||||
</DialogTitle>
|
aria-labelledby="form-dialog-title"
|
||||||
<DialogContent className={classes.dialogContent}>
|
{...props}>
|
||||||
{data && <P>{data}</P>}
|
<div className={classes.closeButton}>
|
||||||
</DialogContent>
|
<IconButton size={16} aria-label="close" onClick={innerOnClose}>
|
||||||
|
<CloseIcon />
|
||||||
|
</IconButton>
|
||||||
|
</div>
|
||||||
|
<H2 className={classes.title}>{title}</H2>
|
||||||
|
<DialogContent className={classes.dialogContent}>{data}</DialogContent>
|
||||||
</Dialog>
|
</Dialog>
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -64,7 +64,7 @@ const PhotosCard = memo(({ frontCameraPath, txData }) => {
|
||||||
</Paper>
|
</Paper>
|
||||||
<InformativeDialog
|
<InformativeDialog
|
||||||
open={photosDialog}
|
open={photosDialog}
|
||||||
title={`Photos roll`}
|
title={`Photo roll`}
|
||||||
data={<PhotosCarousel txData={txData}></PhotosCarousel>}
|
data={<PhotosCarousel txData={txData}></PhotosCarousel>}
|
||||||
onDissmised={() => {
|
onDissmised={() => {
|
||||||
setPhotosDialog(false)
|
setPhotosDialog(false)
|
||||||
|
|
@ -79,6 +79,15 @@ export const PhotosCarousel = memo(({ txData }) => {
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
|
<div className={classes.carousel}>
|
||||||
|
<img
|
||||||
|
className={classes.carouselImg}
|
||||||
|
src={`${URI}/operator-data/customersphotos/${
|
||||||
|
R.head(txData)?.txCustomerPhotoPath
|
||||||
|
}`}
|
||||||
|
alt=""
|
||||||
|
/>
|
||||||
|
</div>
|
||||||
<div className={classes.firstRow}>
|
<div className={classes.firstRow}>
|
||||||
<div>
|
<div>
|
||||||
<div>
|
<div>
|
||||||
|
|
|
||||||
|
|
@ -47,8 +47,7 @@ export default {
|
||||||
margin: [[0, 0, 6, 0]]
|
margin: [[0, 0, 6, 0]]
|
||||||
},
|
},
|
||||||
firstRow: {
|
firstRow: {
|
||||||
padding: [[8]],
|
padding: [[8]]
|
||||||
marginBottom: 10
|
|
||||||
},
|
},
|
||||||
secondRow: {
|
secondRow: {
|
||||||
extend: p,
|
extend: p,
|
||||||
|
|
@ -64,5 +63,19 @@ export default {
|
||||||
marginRight: 55
|
marginRight: 55
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
},
|
||||||
|
carousel: {
|
||||||
|
alignItems: 'center',
|
||||||
|
justifyContent: 'center',
|
||||||
|
display: 'flex',
|
||||||
|
width: 550,
|
||||||
|
height: 550
|
||||||
|
},
|
||||||
|
carouselImg: {
|
||||||
|
objectFit: 'cover',
|
||||||
|
objectPosition: 'center',
|
||||||
|
width: 550,
|
||||||
|
height: 550,
|
||||||
|
marginBottom: 40
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue