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

[feat/#46] 모달 중복 오픈 수정 #107

Merged
merged 2 commits into from
Sep 27, 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
2 changes: 1 addition & 1 deletion src/components/Modal/JoinCrewModal.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ const JoinCrewModal = (props: ModalProps): React.ReactElement => {
{/* crew description */}
<div className="flex flex-col gap-1">
<div className="text-[15px] font-semibold">크루소개</div>
<div className="h-[80px] overflow-scroll rounded-xl border border-gray-200 bg-zinc-100 p-[12px] text-[15px] font-normal text-zinc-900">
<div className="scrollbar-hide h-[80px] overflow-auto rounded-xl border border-gray-200 bg-zinc-100 p-[12px] text-[15px] font-normal text-zinc-900">
{data?.description}
</div>
</div>
Expand Down
1 change: 1 addition & 0 deletions src/hooks/useModals.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ export const useModals = (): UseModalResult => {
const modalsState = useContext(ModalsStateContext)

const openModal = (Component: ModalComponent, props: ModalProps): void => {
if (modalsState.findIndex((m) => m.Component === Component) >= 0) return
open(Component, props)
}

Expand Down
1 change: 0 additions & 1 deletion src/providers/ModalsProvider.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ const ModalsProvider = ({ children }: PropsWithChildren): React.ReactNode => {
const [openedModals, setOpenedModals] = useState<ModalsState>([])

const open = (Component: ModalComponent, props: ModalProps): void => {
console.log(Component, props)
setOpenedModals((modals) => {
return [...modals, { Component, props }]
})
Expand Down
Loading