mirror of
https://github.com/hazemKrimi/crimson-quirks-ui.git
synced 2026-05-01 18:20:28 +00:00
Add close prototype editing control button
This commit is contained in:
@@ -15,7 +15,7 @@ import { useNavigate, useParams } from 'react-router-dom';
|
|||||||
import { useLazyQuery, useMutation, useReactiveVar } from '@apollo/client';
|
import { useLazyQuery, useMutation, useReactiveVar } from '@apollo/client';
|
||||||
import { Navigate } from 'react-router';
|
import { Navigate } from 'react-router';
|
||||||
import { roleVar } from '../../graphql/state';
|
import { roleVar } from '../../graphql/state';
|
||||||
import { Empty, ArrowLeft, Edit, CheckCircle } from '../../assets';
|
import { Empty, ArrowLeft, Edit, Close, CheckCircle } from '../../assets';
|
||||||
import {
|
import {
|
||||||
Box,
|
Box,
|
||||||
Text,
|
Text,
|
||||||
@@ -186,8 +186,6 @@ const Prototype = () => {
|
|||||||
}
|
}
|
||||||
|
|
||||||
setEditing(false);
|
setEditing(false);
|
||||||
} else {
|
|
||||||
setEditing(true);
|
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -292,9 +290,21 @@ const Prototype = () => {
|
|||||||
showInteractive={false}
|
showInteractive={false}
|
||||||
showFitView
|
showFitView
|
||||||
>
|
>
|
||||||
<ControlButton onClick={handleEditPrototype}>
|
{!editing && (
|
||||||
{!editing ? <Edit /> : <CheckCircle />}
|
<ControlButton onClick={() => setEditing(true)}>
|
||||||
|
<Edit />
|
||||||
</ControlButton>
|
</ControlButton>
|
||||||
|
)}
|
||||||
|
{editing && (
|
||||||
|
<>
|
||||||
|
<ControlButton onClick={() => setEditing(false)}>
|
||||||
|
<Close />
|
||||||
|
</ControlButton>
|
||||||
|
<ControlButton onClick={handleEditPrototype}>
|
||||||
|
<CheckCircle />
|
||||||
|
</ControlButton>
|
||||||
|
</>
|
||||||
|
)}
|
||||||
</Controls>
|
</Controls>
|
||||||
</>
|
</>
|
||||||
)}
|
)}
|
||||||
|
|||||||
Reference in New Issue
Block a user