-
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.
Browse files
Browse the repository at this point in the history
- Loading branch information
1 parent
efee62c
commit f99a69b
Showing
17 changed files
with
171 additions
and
54 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
This file was deleted.
Oops, something went wrong.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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
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,90 @@ | ||
import { css } from "@styled-system/css"; | ||
|
||
import { TteokgukBackgroudColor } from "@/types/tteokguk"; | ||
import { IngredientKey } from "@/types/ingredient"; | ||
|
||
import Button from "../common/Button"; | ||
|
||
import TteokgukImage from "@/components/common/TteokgukImage"; | ||
import Modal from "@/components/common/modal/Modal"; | ||
import useRouter from "@/routes/useRouter"; | ||
|
||
interface Props { | ||
isOpen: boolean; | ||
onClose: () => void; | ||
tteokgukId?: number; | ||
isCompletion?: boolean; | ||
nickname?: string; | ||
tteokgukBackgroundColor: TteokgukBackgroudColor; | ||
frontGarnish: IngredientKey; | ||
backGarnish: IngredientKey; | ||
} | ||
|
||
const SuccessfulTteokgukCreationModal = ({ | ||
isOpen, | ||
onClose, | ||
tteokgukId, | ||
isCompletion = false, | ||
nickname, | ||
tteokgukBackgroundColor, | ||
frontGarnish, | ||
backGarnish, | ||
}: Props) => { | ||
const router = useRouter(); | ||
|
||
const handleClickButton = () => { | ||
onClose(); | ||
|
||
if (!isCompletion && tteokgukId) { | ||
router.push(`/tteokguks/${tteokgukId}`); | ||
} | ||
}; | ||
|
||
return ( | ||
isOpen && ( | ||
<Modal> | ||
<Modal.Header> | ||
{isCompletion ? "소원 떡국이 완성되었어요!" : "소원 떡국 제작 성공!"} | ||
</Modal.Header> | ||
<Modal.Body> | ||
<div> | ||
<div className={styles.description}> | ||
{isCompletion | ||
? `${nickname}님의 새해 소원, 이루어져라 얍✨` | ||
: "내 재료와 친구들의 응원으로 떡국을 완성해보세요!"} | ||
</div> | ||
<div className={styles.imageContainer}> | ||
<TteokgukImage | ||
completion | ||
backgroundColor={tteokgukBackgroundColor} | ||
frontGarnish={frontGarnish} | ||
backGarnish={backGarnish} | ||
/> | ||
</div> | ||
<Button onClick={handleClickButton}> | ||
{isCompletion ? "확인" : "소원 떡국 페이지로 가기"} | ||
</Button> | ||
</div> | ||
</Modal.Body> | ||
</Modal> | ||
) | ||
); | ||
}; | ||
|
||
export default SuccessfulTteokgukCreationModal; | ||
|
||
const styles = { | ||
description: css({ | ||
fontSize: "1.4rem", | ||
marginTop: "0.8rem", | ||
}), | ||
imageContainer: css({ | ||
position: "relative", | ||
width: "100%", | ||
height: "21rem", | ||
overflow: "hidden", | ||
borderRadius: "0.8rem", | ||
marginTop: "2.4rem", | ||
marginBottom: "3.8rem", | ||
}), | ||
}; |
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
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
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
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
Oops, something went wrong.