1+ import { useRouter } from 'next/navigation' ;
12import { type SVGProps } from 'react' ;
23import * as React from 'react' ;
34
45interface Props {
6+ isFirstGoalSetting : boolean ;
57 setIsSettingNewModal : React . Dispatch < React . SetStateAction < boolean > > ;
68 isSettingNewGoalModal : boolean ;
79 resetData : ( ) => void ;
@@ -10,8 +12,15 @@ interface Props {
1012}
1113
1214const SettingNewGoalModal = ( props : Props ) => {
13- const { setIsSettingNewModal, isSettingNewGoalModal, resetData, setIsResetButtonClick, fetchDataAndUpdateState } =
14- props ;
15+ const {
16+ isFirstGoalSetting = false ,
17+ setIsSettingNewModal,
18+ isSettingNewGoalModal,
19+ resetData,
20+ setIsResetButtonClick,
21+ fetchDataAndUpdateState,
22+ } = props ;
23+ const router = useRouter ( ) ;
1524 return (
1625 < >
1726 < div
@@ -28,10 +37,14 @@ const SettingNewGoalModal = (props: Props) => {
2837 </ div >
2938 < div className = { 'flex flex-col gap-y-4 bg-white rounded-[32px] p-5' } >
3039 < div className = { 'flex flex-col gap-y-1' } >
31- < div className = { 'text-h2 font-semibold text-black' } > 이전 목표를 불러올까요?</ div >
40+ < div className = { 'text-h2 font-semibold text-black' } >
41+ { isFirstGoalSetting ? '이전에 세우신 목표가 없어요!' : '이전 목표를 불러올까요?' }
42+ </ div >
3243 < div >
33- < div className = { 'flex items-center text-h6' } > 정보를 불러오면 이전에 설정한 목표를</ div >
34- < div className = { 'text-h6' } > 토대로 작성할 수 있어요.</ div >
44+ < div className = { 'flex items-center text-h6' } >
45+ { isFirstGoalSetting ? '새로운 목표를 세워보시겠어요?' : '정보를 불러오면 이전에 설정한 목표를' }
46+ </ div >
47+ { ! isFirstGoalSetting && < div className = { 'text-h6' } > 토대로 작성할 수 있어요.</ div > }
3548 </ div >
3649 </ div >
3750 < div className = { 'flex justify-end gap-x-2' } >
@@ -44,14 +57,16 @@ const SettingNewGoalModal = (props: Props) => {
4457 className = { 'bg-gray1 rounded-full text-gray4 py-[7px] px-4' } >
4558 새 목표
4659 </ button >
47- < button
48- onClick = { ( ) => {
49- fetchDataAndUpdateState ( ) ;
50- setIsSettingNewModal ( ! isSettingNewGoalModal ) ;
51- } }
52- className = { 'bg-black rounded-full text-white py-[7px] px-3' } >
53- 불러오기
54- </ button >
60+ { ! isFirstGoalSetting && (
61+ < button
62+ onClick = { ( ) => {
63+ fetchDataAndUpdateState ( ) ;
64+ setIsSettingNewModal ( ! isSettingNewGoalModal ) ;
65+ } }
66+ className = { 'bg-black rounded-full text-white py-[7px] px-3' } >
67+ 불러오기
68+ </ button >
69+ ) }
5570 </ div >
5671 </ div >
5772 </ div >
0 commit comments