|
@@ -120,10 +120,7 @@ const EditList = (props: IEditList) => {
|
|
|
|
|
|
const handleCloseCamera = (e: any) => {
|
|
|
const id = e.target.id
|
|
|
- if (id === 'overlay') {
|
|
|
- setCamera(false)
|
|
|
- setOpenBtn(true)
|
|
|
- }
|
|
|
+ if (id === 'overlay') setCamera(false)
|
|
|
}
|
|
|
|
|
|
useEffect(() => {
|
|
@@ -154,8 +151,8 @@ const EditList = (props: IEditList) => {
|
|
|
'&:hover': { color: 'rgb(41, 139, 231)' },cursor:'pointer'}}/>
|
|
|
</div>
|
|
|
{camera &&
|
|
|
- <div onClick={handleCloseCamera}
|
|
|
- className={classes.overlay} id='overlay'>
|
|
|
+ <div onClick={handleCloseCamera} id='overlay'
|
|
|
+ className={classes.overlay}>
|
|
|
<Webcam
|
|
|
audio={false}
|
|
|
screenshotFormat="image/jpeg"
|
|
@@ -164,7 +161,10 @@ const EditList = (props: IEditList) => {
|
|
|
style={{marginBottom:30}}
|
|
|
>
|
|
|
{({ getScreenshot }) => <>
|
|
|
- <CameraIcon onClick={() => setSelfie(getScreenshot())}
|
|
|
+ <CameraIcon onClick={() => {
|
|
|
+ setSelfie(getScreenshot())
|
|
|
+ setOpenBtn(true)
|
|
|
+ }}
|
|
|
className={classes.capturePhoto} fontSize='large' style={{marginBottom:30}} />
|
|
|
<img className={classes.capturedPicture} width='300' height='174'
|
|
|
style={{visibility:selfie?'visible':'hidden'}} src={selfie} alt='chosen pic'></img>
|