Skip to content

Commit

Permalink
feat: once a action is selected close the action modal
Browse files Browse the repository at this point in the history
  • Loading branch information
sunilsabatp committed Nov 7, 2024
1 parent 2fbe97f commit 71440bb
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion src/temp/AddressManagment/microComponents/AddressActions.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,10 @@ const AddressActions = ({ type }: { type: AddressType }) => {
setPopoverAnchor(null);
};

const handleActionClick = (action: AddressAction) => {
setPopoverAnchor(null);
};

const open = Boolean(popoverAnchor);
const id = open ? 'simple-popover' : undefined;

Expand Down Expand Up @@ -82,7 +86,11 @@ const AddressActions = ({ type }: { type: AddressType }) => {
>
<ul className={styles.addressActions}>
{addressActions.map((item, key) => (
<li key={key} className={styles.action}>
<li
key={key}
className={styles.action}
onClick={() => handleActionClick(item.action)}
>
{item.label}
</li>
))}
Expand Down

0 comments on commit 71440bb

Please sign in to comment.