Skip to content

Commit f5eaa0e

Browse files
committed
feat: added edit value that toggles CreateShape between edit and create
1 parent 2fc7c18 commit f5eaa0e

3 files changed

Lines changed: 5 additions & 3 deletions

File tree

components/core/CreateShape.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -328,7 +328,7 @@ const CreateShape = (props) => {
328328
backdrop="static"
329329
>
330330
<Modal.Header closeButton>
331-
<Modal.Title>Create a Shape</Modal.Title>
331+
<Modal.Title>{props.edit ? "Edit Shape" : "Create Shape"}</Modal.Title>
332332
</Modal.Header>
333333
<Modal.Body>
334334
<Container fluid>

components/utils/Header.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -238,6 +238,7 @@ const Header = ({
238238
<CreateShape
239239
show={showCreateShape}
240240
handleClose={closeModal}
241+
edit={false}
241242
user={user}
242243
shapeAction={shapeAction}
243244
setShapeAction={setShapeAction} />

components/utils/ShapeList.js

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -388,7 +388,8 @@ const ShapeList = (
388388
{ shapeToEdit && <CreateShape
389389
show= {showEditModal}
390390
handleClose={ closeEditModal }
391-
shapeInformation= { shapeToSourceCopy } />
391+
shapeInformation= { shapeToEdit }
392+
edit={true} />
392393
}
393394

394395
{
@@ -438,7 +439,7 @@ const ShapeList = (
438439
size={24} />
439440
</Button>
440441
{shape.private ?
441-
<Button title="Edit Shape" vairant="outline-light" onClick={() => performEdit(shape)} className="btn-icon">
442+
<Button title="Edit Shape" vairant="outline-light" onClick={() => {performEdit(shape); console.log(shape)}} className="btn-icon">
442443
Edit
443444
</Button> : null
444445
}

0 commit comments

Comments
 (0)