Skip to content

Commit e48761f

Browse files
committed
feat: form now fully resets after the creation of a shape
1 parent dea6337 commit e48761f

3 files changed

Lines changed: 11 additions & 3 deletions

File tree

components/core/CreateShape.js

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -301,6 +301,13 @@ const CreateShape = (props) => {
301301
"shape_id": insertShape['inserted_hashes']
302302
}
303303
});
304+
305+
setShapeInformation({
306+
...initialState,
307+
});
308+
309+
setValidated(false);
310+
304311
} else {
305312
toast.error('OOPS!! We hit a bummer. Please try again.');
306313
}

components/utils/DraggableVertice.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,8 @@ const DraggableVertice = (props) => {
4646
handle=".handle"
4747
position={{x: x, y: y}}
4848
grid={[2.8, 2.8]}
49-
onDrag={(e, data) => {handleDrag(e, data); props.setFocusNumber(-1)}}>
49+
onDrag={(e, data) => {handleDrag(e, data); props.setFocusNumber(-1)}}
50+
>
5051
<CircleVertice
5152
className="handle"
5253
onClick={() => {

components/utils/ShapeForm.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ const ShapeForm = (props) => {
4343
</Form.Group>
4444

4545
<Form.Group>
46-
<Form.Label>Color</Form.Label>
46+
<Form.Label>Color picker</Form.Label>
4747
<ColorPicker
4848
type="color"
4949
name="backgroundColor"
@@ -76,7 +76,7 @@ const ShapeForm = (props) => {
7676
<Form.Group>
7777
<Form.Label>CSS clip-Path</Form.Label>
7878
<Form.Control
79-
type="text"
79+
as="textarea"
8080
name="formula"
8181
value={props.shapeInformation.formula}
8282
onChange={props.handleChange}

0 commit comments

Comments
 (0)