Explorar o código

some smal fix with delete pic

unknown %!s(int64=2) %!d(string=hai) anos
pai
achega
b28e7c4110
Modificáronse 2 ficheiros con 8 adicións e 8 borrados
  1. 1 1
      .eslintcache
  2. 7 7
      src/components/HomePage/LeftBar/EditBar/EditList/index.tsx

A diferenza do arquivo foi suprimida porque é demasiado grande
+ 1 - 1
.eslintcache


+ 7 - 7
src/components/HomePage/LeftBar/EditBar/EditList/index.tsx

@@ -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>