-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
5 changed files
with
116 additions
and
10 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
49 changes: 49 additions & 0 deletions
49
src/components/_common/Modal/WelcomeModal/WelcomeModalContainer.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
"use client"; | ||
|
||
import { useRouter } from "next/navigation"; | ||
import useIsSearchBarFocusStore from "@/stores/isSearchBarFocus"; | ||
import useWelcomeModalOpenStore from "@/stores/welcomeModalOpen"; | ||
|
||
const WelcomeModalContainer = () => { | ||
const router = useRouter(); | ||
const { setIsFocus } = useIsSearchBarFocusStore(); | ||
const { setIsOpen } = useWelcomeModalOpenStore(); | ||
|
||
const handleClickSearchAction = () => { | ||
router.push("/"); | ||
setIsFocus(true); | ||
setIsOpen(false); | ||
}; | ||
|
||
const handleClickCreateAction = () => { | ||
router.push("/steady/create"); | ||
setIsOpen(false); | ||
}; | ||
|
||
return ( | ||
<div className="flex h-full w-full flex-col items-center justify-evenly"> | ||
<div className="flex w-full flex-col items-center justify-center gap-10"> | ||
<div className="text-25 font-bold">🧐 스테디에 참여하고 싶은 사람</div> | ||
|
||
<button | ||
onClick={handleClickSearchAction} | ||
className="text-black h-200 w-full rounded-10 text-30 font-bold hover:bg-st-skyblue-50" | ||
> | ||
🔎 스테디 검색 | ||
</button> | ||
</div> | ||
<div className="flex w-full flex-col items-center justify-center gap-10"> | ||
<div className="text-25 font-bold">🤗 스테디를 운영하고 싶은 사람</div> | ||
|
||
<button | ||
className="text-black h-200 w-full rounded-10 text-30 font-bold hover:bg-st-skyblue-50" | ||
onClick={handleClickCreateAction} | ||
> | ||
✍️ 스테디 생성 | ||
</button> | ||
</div> | ||
</div> | ||
); | ||
}; | ||
|
||
export default WelcomeModalContainer; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
"use client"; | ||
|
||
import useWelcomeModalOpenStore from "@/stores/welcomeModalOpen"; | ||
import { AlertDialog } from "@radix-ui/themes"; | ||
import Icon from "../../Icon"; | ||
import WelcomeModalContainer from "./WelcomeModalContainer"; | ||
|
||
const WelcomeModal = () => { | ||
const { isOpen, setIsOpen } = useWelcomeModalOpenStore(); | ||
|
||
return ( | ||
<AlertDialog.Root | ||
open={isOpen} | ||
onOpenChange={setIsOpen} | ||
> | ||
<AlertDialog.Content className="max-mobile:h-3/4 max-mobile:w-screen max-mobile:p-10 flex h-700 w-650 items-center justify-center overflow-y-hidden rounded-20 bg-st-primary"> | ||
<div className="flex h-full w-full flex-col items-center justify-center rounded-20 bg-st-white p-20"> | ||
<AlertDialog.Cancel onClick={() => setIsOpen(false)}> | ||
<div className="flex w-full cursor-pointer justify-end"> | ||
<Icon | ||
name="cross" | ||
size={20} | ||
color="text-black" | ||
/> | ||
</div> | ||
</AlertDialog.Cancel> | ||
<WelcomeModalContainer /> | ||
</div> | ||
</AlertDialog.Content> | ||
</AlertDialog.Root> | ||
); | ||
}; | ||
|
||
export default WelcomeModal; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
import { create } from "zustand"; | ||
import { persist } from "zustand/middleware"; | ||
|
||
interface isOpenStateType { | ||
isOpen: boolean; | ||
// eslint-disable-next-line no-unused-vars | ||
setIsOpen: (isOpen: boolean) => void; | ||
} | ||
|
||
const useWelcomeModalOpenStore = create( | ||
persist<isOpenStateType>( | ||
(set) => ({ | ||
isOpen: false, | ||
setIsOpen: (isOpen) => set({ isOpen }), | ||
}), | ||
{ | ||
name: "welcomeModalKey", | ||
}, | ||
), | ||
); | ||
|
||
export default useWelcomeModalOpenStore; |