Skip to content
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

[Refactor] PhoneNumberOverlay 리팩토링 후 적용 #32

Merged
merged 5 commits into from
Aug 13, 2024
Merged

Conversation

minani-0621
Copy link
Contributor

✅ 구현사항

  • PhoneNumberOverlay 리팩토링 후 적용
  • 레이싱 게임 응모 도중에 기대평 선택 시 선택한 옵션이 있어야만 다음 페이지로 넘어갈 수 있도록 구현
  • 레이싱 게임 응모 후에도 게임 종료 버튼 뜨도록 구현

PhoneNumberOverlay 리팩토링

interface PhoneNumberOverlayProps {
  type: "findCasper" | "raceCasper";
}

const PhoneNumberOverlay = ({ type }: PhoneNumberOverlayProps) => {
   ... 코드 생략

type이라는 prop를 통해서 숨은그림찾기 게임 버전과 레이싱 게임의 2개 버전으로 사용 가능

<OverLayContent index={0} element={<PhoneNumberOverlay type="raceCasper" />} />

위 코드는 적용 예시 입니다


레이싱 게임 응모 중에 기대평으로 선택한 옵션이 있을 때만 다음 페이지로 이동 가능

      {enterable === true ? (
        <div
          onClick={() => {
            store.dispatch(action.nextPage());
          }}
          className="bg-[#002C5F] h-[12%] flex items-center justify-center hover:cursor-pointer"
        >
          <p className="text-white text-[20px] font-bold">응모 완료하기</p>
        </div>
      ) : (
        <div className="bg-[#CCCCCC] h-[12%] flex items-center justify-center">
          <p className="text-white text-[20px] font-bold">개인정보를 입력해주세요</p>
        </div>
      )}

enterable state에 따라서 다른 요소로 랜더링

Copy link
Collaborator

@Dunkkkk Dunkkkk left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

좋아요~

@Dunkkkk Dunkkkk merged commit 2778220 into develop Aug 13, 2024
1 check passed
@Dunkkkk Dunkkkk deleted the CC-135 branch August 13, 2024 05:51
@minani-0621 minani-0621 added the Refactor refactoring label Aug 13, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Refactor refactoring
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants