Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Close Button for Modal #284

Merged
merged 3 commits into from
Feb 7, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion app/profile/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ import {
Waitlisted
} from "@/components/Profile/RSVP/ModalViews/Rejected";
import Accepted from "@/components/Profile/RSVP/ModalViews/Accepted";
import CloseButton from "@/components/CloseButton/CloseButton";

type ValueItemProps = {
label: string;
Expand Down Expand Up @@ -136,8 +137,8 @@ const Profile: React.FC = () => {
}}
ariaHideApp={false}
>
<CloseButton handleClose={() => setModalOpen(false)} />
<div className={styles.modalContent}>
{/* TODO: close button */}
<ModalContent
status={RSVP.status}
response={RSVP.response}
Expand Down
11 changes: 11 additions & 0 deletions components/CloseButton/CloseButton.module.scss
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This style doesn't seem to be applying. Maybe the svg should be wrapped in a button (or the style could apply to the svg)?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi @J164 . I wrapped the svg component in a button, so that the hover style would apply to the close button.

For reference, here's what the button looks like now:

Screenshot 2025-02-06 at 11 31 33 PM

Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
.button {
display: flex;
justify-content: center;
align-items: center;
padding: 5px;
margin-left: -5px; // To align the button with the other content
}

.button:hover {
cursor: pointer;
}
21 changes: 21 additions & 0 deletions components/CloseButton/CloseButton.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
import styles from "./CloseButton.module.scss";

const CloseButton = ({ handleClose }: { handleClose: () => void }) => {
return (
<button className={styles.button} onClick={handleClose}>
<svg
xmlns="http://www.w3.org/2000/svg"
viewBox="0 0 24px 24px"
width="24px"
height="24px"
>
<path
fill="#000000"
d="M19 6.41L17.59 5L12 10.59L6.41 5L5 6.41L10.59 12L5 17.59L6.41 19L12 13.41L17.59 19L19 17.59L13.41 12z"
></path>
</svg>
</button>
);
};

export default CloseButton;