Skip to content

Commit

Permalink
Fixes #492: Added delete button for deleting textBoxes (#513)
Browse files Browse the repository at this point in the history
* Update pnpm-lock.yaml

* Resolved merge conflicts

* Replace remote files with local files

---------

Co-authored-by: Subramani E <[email protected]>
  • Loading branch information
Ajay-Krishna00 and subru-37 authored Nov 29, 2024
1 parent 99ed032 commit 055d7df
Show file tree
Hide file tree
Showing 3 changed files with 14,073 additions and 14,063 deletions.
2 changes: 1 addition & 1 deletion apps/registration-admin/tsconfig.app.tsbuildinfo
Original file line number Diff line number Diff line change
@@ -1 +1 @@
{"root":["./src/App.tsx","./src/main.tsx","./src/vite-env.d.ts","./src/hooks/useAlert.tsx","./src/hooks/useFetch.tsx","./src/pages/Form.tsx","./src/pages/NotFound.tsx","./src/pages/Registered.tsx"],"version":"5.7.2"}
{"root":["./src/App.tsx","./src/main.tsx","./src/vite-env.d.ts","./src/hooks/useAlert.tsx","./src/hooks/useFetch.tsx","./src/pages/Form.tsx","./src/pages/NotFound.tsx","./src/pages/Registered.tsx"],"version":"5.7.2"}
10 changes: 10 additions & 0 deletions apps/web-admin/src/components/CertificateUploadBox.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ import {
import dynamic from 'next/dynamic';
// import { useEffect } from 'react';
import { KonvaEventObject } from 'konva/lib/Node'; // Import for event types
import { set } from 'date-fns';
const Stage = dynamic(() => import('react-konva').then((mod) => mod.Stage), { ssr: false });
const Layer = dynamic(() => import('react-konva').then((mod) => mod.Layer), { ssr: false });
const KonvaImage = dynamic(() => import('react-konva').then((mod) => mod.Image), { ssr: false });
Expand Down Expand Up @@ -197,6 +198,12 @@ function CertifcateUploadBox() {
}
};

const handleDelete = () => {
setTexts((prevTexts) => prevTexts.filter((text) => text.id !== selectedText.id));
setSelectedText(null);
onClose();
};

return (
<Box
display="flex"
Expand Down Expand Up @@ -384,6 +391,9 @@ function CertifcateUploadBox() {
{/* You can add font and color selectors here */}
</ModalBody>
<ModalFooter>
<Button marginRight={'9.3em'} colorScheme="red" onClick={handleDelete}>
Delete
</Button>
<Button colorScheme="teal" onClick={handleModalSubmit}>
Save
</Button>
Expand Down
Loading

0 comments on commit 055d7df

Please sign in to comment.