From 69e72580763de8059df0b8f38de1c58794846446 Mon Sep 17 00:00:00 2001 From: Hazem Krimi Date: Sat, 20 May 2023 19:59:53 +0100 Subject: [PATCH] Add close prototype editing control button --- src/pages/Prototype/index.tsx | 22 ++++++++++++++++------ 1 file changed, 16 insertions(+), 6 deletions(-) diff --git a/src/pages/Prototype/index.tsx b/src/pages/Prototype/index.tsx index d83d66b..ab24801 100644 --- a/src/pages/Prototype/index.tsx +++ b/src/pages/Prototype/index.tsx @@ -15,7 +15,7 @@ import { useNavigate, useParams } from 'react-router-dom'; import { useLazyQuery, useMutation, useReactiveVar } from '@apollo/client'; import { Navigate } from 'react-router'; import { roleVar } from '../../graphql/state'; -import { Empty, ArrowLeft, Edit, CheckCircle } from '../../assets'; +import { Empty, ArrowLeft, Edit, Close, CheckCircle } from '../../assets'; import { Box, Text, @@ -186,8 +186,6 @@ const Prototype = () => { } setEditing(false); - } else { - setEditing(true); } }; @@ -292,9 +290,21 @@ const Prototype = () => { showInteractive={false} showFitView > - - {!editing ? : } - + {!editing && ( + setEditing(true)}> + + + )} + {editing && ( + <> + setEditing(false)}> + + + + + + + )} )}