-
Notifications
You must be signed in to change notification settings - Fork 2
fix: 온보딩 애니메이션 오류 해결 #41
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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 hidden or 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 hidden or 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,38 @@ | ||
| import { useNavigate } from 'react-router'; | ||
|
|
||
| export default function index() { | ||
| // eslint-disable-next-line react-hooks/rules-of-hooks | ||
| const navigate = useNavigate(); | ||
| return ( | ||
| <main className="animate-fadeIn absolute inset-0 flex h-full w-full flex-col justify-end bg-white px-5 pt-7.5 pb-4 opacity-0"> | ||
| <article className="basic-theme mt-7.5 mb-9 grow pl-4"> | ||
| <h1 className="font-malang mt-15">To.따숨이</h1> | ||
| <h2 className="font-malang">환영합니다! 우리 함께 마음을 나누어 보아요</h2> | ||
| <section className="mt-9" style={{ fontFamily: 'KyoboHandwriting2020A' }}> | ||
| <p>안녕하세요, 따숨이님!</p> | ||
| <br /> | ||
| <p>요즘 어떤 말을 하고싶으신가요?</p> | ||
| <p>36.5에서 따뜻한 마음의 편지를 나누어 보세요.</p> | ||
| <br /> | ||
| <p>따뜻한 편지 문화를 위해 아래의 안내 사항을 숙지해주세요!</p> | ||
| <p>1. 욕설, 비방, 성희롱은 금지입니다.</p> | ||
| <p> | ||
| 2. 만약 위의 이유로 신고를 당할 경우 경고를 받게 되고, 세번의 경고를 받게 되면 서비스를 | ||
| 이용하실 수 없습니다. | ||
| </p> | ||
| <p>3. 고민 편지에 대한 답장은 검수 후에 전달됩니다.</p> | ||
| </section> | ||
| <p className="font-malang mt-22">From.9황작물</p> | ||
| </article> | ||
| <button | ||
| className="primary-btn body-sb text-gray-60 h-fit w-full py-2" | ||
| onClick={() => { | ||
| navigate(`/`); | ||
| sessionStorage.removeItem('onBoarding'); | ||
| }} | ||
| > | ||
| 홈으로 가기 | ||
| </button> | ||
| </main> | ||
| ); | ||
| } |
This file contains hidden or 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 hidden or 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 |
|---|---|---|
| @@ -1,14 +1,41 @@ | ||
| import { useState } from 'react'; | ||
| import { useEffect, useState } from 'react'; | ||
|
|
||
| import SetZipCode from './SetZipCode'; | ||
| import UserInteraction from './UserInteraction'; | ||
| import WelcomeLetter from './welcomeLetter'; | ||
|
|
||
| const OnboardingPage = () => { | ||
| const [isZipCodeSet, setIsZipCodeSet] = useState<boolean>(false); | ||
| const [isAnimationOver, setIsAnimationOver] = useState<boolean>(false); | ||
|
|
||
| useEffect(() => { | ||
| if (isZipCodeSet || isAnimationOver) { | ||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 몬가 isZipCodeSet가 true일때 isAnimationOver도 true일거 같은데 && 말고 || 연산자를 사용하신 이유가 있나용?
Collaborator
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 아 각각이 우편번호 끝나면, 편지 애니메이션 끝나면 true가 되는거라 둘중 하나만 바뀌어도 업데이트를 해야돼서요! |
||
| sessionStorage.setItem( | ||
| 'onBoarding', | ||
| JSON.stringify({ isZipCodeSet: isZipCodeSet, isAnimationOver: isAnimationOver }), | ||
| ); | ||
| } | ||
| }, [isZipCodeSet, isAnimationOver]); | ||
|
|
||
| useEffect(() => { | ||
| const prevDataString = sessionStorage.getItem('onBoarding'); | ||
| if (prevDataString) { | ||
| const newData = JSON.parse(prevDataString); | ||
| console.log(newData); | ||
| setIsZipCodeSet(newData.isZipCodeSet); | ||
| setIsAnimationOver(newData.isAnimationOver); | ||
| console.log('isZipCode', isZipCodeSet, 'isAnimation', isAnimationOver); | ||
| } | ||
| }, []); | ||
| return ( | ||
| <main className="inset-0 mx-5 mt-20 mb-[1.875rem] flex grow flex-col items-center justify-between overflow-hidden"> | ||
| {isZipCodeSet ? <UserInteraction /> : <SetZipCode setIsZipCodeSet={setIsZipCodeSet} />} | ||
| {!isZipCodeSet ? ( | ||
| <SetZipCode setIsZipCodeSet={setIsZipCodeSet} /> | ||
| ) : !isAnimationOver ? ( | ||
| <UserInteraction setIsAnimationOver={setIsAnimationOver} /> | ||
| ) : ( | ||
| <WelcomeLetter /> | ||
| )} | ||
| </main> | ||
| ); | ||
| }; | ||
|
|
||
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
편지 열리는거 이뻤는데 아쉽군요 ㅠ