From 6bb3530a83393453f9a708d134d76901d14c44ab Mon Sep 17 00:00:00 2001 From: kcwww Date: Fri, 19 Apr 2024 13:05:50 +0900 Subject: [PATCH] chore: make flow without backend api --- front/src/components/Button/Button.tsx | 2 +- .../pages/Make/Snowball/MainDeco/MakeButton.tsx | 9 ++++++++- front/src/pages/Make/Snowball/Snowball.tsx | 14 ++++++++------ 3 files changed, 17 insertions(+), 8 deletions(-) diff --git a/front/src/components/Button/Button.tsx b/front/src/components/Button/Button.tsx index b113d9b..76a32f8 100644 --- a/front/src/components/Button/Button.tsx +++ b/front/src/components/Button/Button.tsx @@ -22,7 +22,7 @@ const Button = (props: ButtonProps) => { props.view[1](!props.view[0]) : props.callback // temp } diff --git a/front/src/pages/Make/Snowball/MainDeco/MakeButton.tsx b/front/src/pages/Make/Snowball/MainDeco/MakeButton.tsx index fd9fa6b..b78e4e3 100644 --- a/front/src/pages/Make/Snowball/MainDeco/MakeButton.tsx +++ b/front/src/pages/Make/Snowball/MainDeco/MakeButton.tsx @@ -65,7 +65,14 @@ const MakeButton = (props: ButtonProps) => { {alert ? ( 스노우볼 이름을 입력해주세요 ! ) : null} - + { + //temp + navigate('/'); + }} + > {props.text} diff --git a/front/src/pages/Make/Snowball/Snowball.tsx b/front/src/pages/Make/Snowball/Snowball.tsx index ef3ec42..81261f9 100644 --- a/front/src/pages/Make/Snowball/Snowball.tsx +++ b/front/src/pages/Make/Snowball/Snowball.tsx @@ -67,7 +67,8 @@ const Snowball = () => { const [make, setMake] = useState(false); const [cookie] = useCookies(['loggedin']); - const [{ snowBallData, userData }] = useRecoilState(SnowBallRecoil); + const [{ snowBallData, userData }, setSnowball] = + useRecoilState(SnowBallRecoil); const maxSnowball = 5; @@ -75,17 +76,18 @@ const Snowball = () => { window.history.pushState({}, '', '/make/snowball'); useEffect(() => { - if (!cookie.loggedin) { - logout(); - return; - } + // if (!cookie.loggedin) { + // logout(); + // return; + // } if ( userData.nickname === null || userData.nickname === undefined || userData.nickname === '' ) { - navigate('/make/nickname'); + // navigate('/make/nickname'); + setSnowball(prev => ({ ...prev, nickname: '김부캠' })); // temp return; }