Skip to content

Commit

Permalink
Merge pull request #107 from DDD-Community/feat/#46
Browse files Browse the repository at this point in the history
[feat/#46] 모달 중복 오픈 수정
  • Loading branch information
lkhoony authored Sep 27, 2024
2 parents 1cf0d33 + ea28c39 commit 4fd0032
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 2 deletions.
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

0 comments on commit 4fd0032

Please sign in to comment.