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

add x to account edit modal #146

Merged
merged 1 commit into from
Nov 4, 2024
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
1 change: 1 addition & 0 deletions src/app/(management-portal)/layout.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@ export default function Layout({ children }: { children: React.ReactNode }) {
<div className={styles["rest-of-page"]}>
<Modal showModal={showModal} setShowModal={setShowModal}>
<AccountEditModal
setShowModal={setShowModal}
className={styles.accountEditModalContent}
setShowSuccessModal={setShowSuccessModal}
/>
Expand Down
10 changes: 10 additions & 0 deletions src/components/AccountEditModal/AccountEditModal.module.css
Original file line number Diff line number Diff line change
Expand Up @@ -204,3 +204,13 @@
justify-content: flex-end;
gap: 15px;
}

.close {
width: fit-content;
}

.closeButton {
cursor: pointer;
height: fit-content;
width: fit-content;
}
14 changes: 13 additions & 1 deletion src/components/AccountEditModal/AccountEditModal.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import { CSSProperties, useState } from "react";
import { classes } from "@src/utils/utils";

import useAuth from "@src/hooks/useAuth";
import XIcon from "@/src/app/icons/XIcon";
import styles from "./AccountEditModal.module.css";
import Profile from "./Profile";
import Password from "./Password";
Expand All @@ -13,12 +14,18 @@ const enum Page {
}

interface Props {
setShowModal: (args: boolean) => void;
className?: string;
style?: CSSProperties;
setShowSuccessModal: (args: boolean) => void;
}

const Modal = ({ className, style, setShowSuccessModal }: Props) => {
const Modal = ({
setShowModal,
className,
style,
setShowSuccessModal,
}: Props) => {
const [page, setPage] = useState<Page>(Page.PROFILE);
const { logout } = useAuth();
const router = useRouter();
Expand Down Expand Up @@ -58,6 +65,11 @@ const Modal = ({ className, style, setShowSuccessModal }: Props) => {
<Password setShowSuccessModal={setShowSuccessModal} />
)}
</div>
<div className={styles.close}>
<div className={styles.closeButton} onClick={() => setShowModal(false)}>
<XIcon />
</div>
</div>
</div>
);
};
Expand Down
Loading