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

[FE] feat: 문제 보여주기 #153

Merged
merged 6 commits into from
Nov 28, 2023
Merged

Conversation

d0422
Copy link
Collaborator

@d0422 d0422 commented Nov 28, 2023

PR 설명

문제 보여주기 기능 추가

✅ 완료한 기능 명세

  • 모달을 통해 링크를 입력받고 이를 통해 문제를 보여주는 기능
  • 변경하기 버튼을 눌러 변경하는 기능
  • url별로 캐시하는 기능

📸 스크린샷

image

2023-11-28.20-47-53.mp4

고민과 해결과정

overflow-x처리, click disable

iframe내부의 body의 overflow를 해제시켜줘야했다.

  useEffect(() => {
    const iframe = iframeRef.current;
    const handleLoad = () => {
      const innerDocument = iframe?.contentDocument; //이렇게 내부 문서의 document를 가져온다.
      if (innerDocument) {
        overFlowXHidden(innerDocument);
        clickDisable(innerDocument);
      }
    };
    if (iframe && htmlData) {
      iframe.srcdoc = htmlData;
      iframe.onload = handleLoad;
    }
  }, [htmlData]);

fetching이 오래걸리는 문제

isLoading이면 로딩 컴포넌트를 보여주는 형태로 UX를 개선했다.
Suspense는 이후에 도입해볼 생각이다.

퀴즈데이터를 받아오는 함수 구현
(#151)
공통 Dark버튼 추가
문제를 모달로 입력받고 보여주는 기능추가
변경하기 버튼을 눌러 다시 입력받고, 변경하는 기능 추가
(#151)
QuizViewSection컴포넌트 파일로 분리
(#151)
@d0422 d0422 linked an issue Nov 28, 2023 that may be closed by this pull request
3 tasks
@d0422 d0422 self-assigned this Nov 28, 2023
@d0422 d0422 added feature 기능 구현 FrontEnd 프론트엔드 관련 labels Nov 28, 2023
문제 로드중 로딩 컴포넌트를 보여주도록 처리
(#151)
로딩 컴포넌트 개선
(#151)
@d0422 d0422 requested a review from HBSPS November 28, 2023 11:52
Copy link
Collaborator

@HBSPS HBSPS left a comment

Choose a reason for hiding this comment

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

LGTM!

@@ -2,12 +2,13 @@ import useFocus from '@/hooks/useFocus';
import useInput from '@/hooks/useInput';
import useModal from '@/hooks/useModal';

export default function LinkInputModal() {
export default function LinkInputModal({ setURL }: { setURL: React.Dispatch<React.SetStateAction<string>> }) {
Copy link
Collaborator

Choose a reason for hiding this comment

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

다른 컴포넌트와 동일하게 Props를 interface로 정의하는것은 어떨까요??

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

모달 컴포넌트의 경우 useModal의 Props type때문에 타입 정의를 명확하게 할 수가 없네요 ㅠㅠ

@d0422 d0422 merged commit 661e9b5 into boostcampwm2023:dev Nov 28, 2023
6 checks passed
d0422 referenced this pull request in d0422/web05-AlgoITNi Nov 28, 2023
merge: [FE] 문제 보여주기 (#153)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature 기능 구현 FrontEnd 프론트엔드 관련
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[FE] 문제 가져오기
2 participants