Skip to content

Commit

Permalink
Remove dismiss when not repeatable
Browse files Browse the repository at this point in the history
  • Loading branch information
aweell committed Nov 21, 2024
1 parent e7e0334 commit bc0d535
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 14 deletions.
7 changes: 1 addition & 6 deletions src/pages/advent-calendar-2024/components/calendar-card.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -48,11 +48,6 @@ const CalendarCard = ({
onEndDay(); // Notify the parent to update the state
};

const handleDismiss = () => {
dialogRef.current.close();
isRepeatable && onEndDay();
};

let cardStatusStyles;

switch (status) {
Expand Down Expand Up @@ -217,7 +212,7 @@ const CalendarCard = ({
description={eventDescription}
content={content ? content({ closeModal: handleCloseModal }) : null}
onClose={handleEndDay}
onCancel={handleDismiss}
onCancel={isRepeatable ? handleEndDay : null}
/>
</>
);
Expand Down
18 changes: 10 additions & 8 deletions src/pages/advent-calendar-2024/components/modal-view.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -74,14 +74,16 @@ const ModalView = forwardRef(
}}
>
{content}
<div style={{ position: "absolute", top: 48, right: 48 }}>
<IconButton
type="neutral"
backgroundType="soft"
Icon={IconCloseRegular}
onPress={onCancel}
/>
</div>
{onCancel !== null && (
<div style={{ position: "absolute", top: 48, right: 48 }}>
<IconButton
type="neutral"
backgroundType="soft"
Icon={IconCloseRegular}
onPress={onCancel}
/>
</div>
)}
</form>
</div>
</dialog>
Expand Down

0 comments on commit bc0d535

Please sign in to comment.