Skip to content

Commit

Permalink
Merge pull request #425 from nerdalert/edit-modal
Browse files Browse the repository at this point in the history
no-op edit submission instead of calling delete submission
  • Loading branch information
vishnoianil authored Dec 14, 2024
2 parents 0383f14 + 55dc129 commit f8a4da8
Showing 1 changed file with 21 additions and 2 deletions.
23 changes: 21 additions & 2 deletions src/components/Dashboard/Native/dashboard.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ const DashboardNative: React.FunctionComponent = () => {
const [isPublishModalOpen, setIsPublishModalOpen] = React.useState(false);
const [selectedBranch, setSelectedBranch] = React.useState<string | null>(null);
const [isPublishing, setIsPublishing] = React.useState(false);
const [isEditModalOpen, setIsEditModalOpen] = React.useState(false);

const getUniqueId = () => new Date().getTime();

Expand Down Expand Up @@ -188,9 +189,14 @@ const DashboardNative: React.FunctionComponent = () => {
}
}
};
const handleEditContribution = async (branchName: string) => {

const handleEditContribution = (branchName: string) => {
setSelectedBranch(branchName);
setIsDeleteModalOpen(true);
setIsEditModalOpen(true);
};

const closeEditModal = () => {
setIsEditModalOpen(false); // Close the modal when needed
};

const handlePublishContribution = async (branchName: string) => {
Expand Down Expand Up @@ -375,6 +381,19 @@ const DashboardNative: React.FunctionComponent = () => {
<p>No differences found.</p>
)}
</Modal>
<Modal
variant={ModalVariant.small}
title="Edit Contribution"
isOpen={isEditModalOpen}
onClose={closeEditModal}
actions={[
<Button key="close" variant="primary" onClick={closeEditModal}>
Close
</Button>
]}
>
<p>Not yet implemented for native mode.</p>
</Modal>
<Modal
variant={ModalVariant.small}
title="Deleting Contribution"
Expand Down

0 comments on commit f8a4da8

Please sign in to comment.