Skip to content
This repository was archived by the owner on Jun 23, 2026. It is now read-only.

랭킹페이지 페이지네이션 API 연결 구현 완료 - #26

Open
xhmxnjxx wants to merge 23 commits into
developfrom
Feature_Issue#11_Leaderboard_Pagination_API
Open

랭킹페이지 페이지네이션 API 연결 구현 완료#26
xhmxnjxx wants to merge 23 commits into
developfrom
Feature_Issue#11_Leaderboard_Pagination_API

Conversation

@xhmxnjxx

@xhmxnjxx xhmxnjxx commented Nov 18, 2022

Copy link
Copy Markdown
Collaborator

Related to #11

체크 리스트

  • 적절한 제목으로 수정했나요?
  • 상단에 이슈 번호를 기입했나요?
  • Target Branch를 올바르게 설정했나요?
  • Label을 알맞게 설정했나요?

작업 내역

  • 랭킹 페이지 페이지네이션 API 연결 구현

비고

  • 버그: 페이지네이션에서 처음 페이지를 누를 때는 랭킹보드가 제대로 뜨는데 다시 그 페이지를 누르면 1위와 2위를 제외한 최상위 한 명의 리더보드만 나옴

@xhmxnjxx xhmxnjxx added the feature 기능 추가 label Nov 18, 2022
@vercel

vercel Bot commented Nov 18, 2022

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Updated
idea-test ✅ Ready (Inspect) Visit Preview Nov 19, 2022 at 6:52PM (UTC)

@xhmxnjxx xhmxnjxx closed this Nov 18, 2022
@xhmxnjxx xhmxnjxx reopened this Nov 18, 2022

// c
"#include <stdio.h>\n\n int main(){\n\n printf(“Hello world” );\n return 0;\n}",
"#include <stdio.h>\n\nint main() {\n printf(“Hello world”);\n return 0;\n}",

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

앗 미세한 오타들을 잘 잡아주셨네요! 이 라인에 printf("Hello world!") 를 보시면 큰따옴표가 양쪽 모양이 다른 일반적인 문서의 큰따옴표로 돼 있어서 실제 입력할 때는 큰따옴표를 입력해도 오타로 인식하더라구요. 아마 요 부분 그냥 코드에디터 상에서 지웠다가 큰 따옴표 입력해주시면 고쳐질 것 같아요!

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

네네 수정해보겠습니다!

Comment thread src/pages/Leaderboard/index.js Outdated
const [offSet, setOffSet] = useState(2);


const topRanks = useRanks(1, pageSize, languageNo, grammarNo).ranks;

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

topRanks 같은 경우 고정적으로 pageSize 2로 해서 받아와도 될 것 같은데 어떻게 생각하시나용

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

앗 그러네요! 반영해서 수정해보도록 하겠습니다!

Comment thread src/pages/Leaderboard/index.js Outdated
Comment thread src/pages/Leaderboard/index.js Outdated
Comment thread src/pages/Leaderboard/index.js Outdated
Comment thread src/pages/Leaderboard/index.js Outdated
ranks.map((rank, index) => (
<LeaderBoardItem
rank={(pageNumber == 1) ? index + 1 + TOP_DISPLAY_USER : index + 1 + pageSize}
rank={rank.ranking}

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

오홍 맞네요 이제 API 자체에서 ranking 을 주니까 pageSizepageNumber 로 계산을 안 해도 돼서 좋군요. 그러면 prop 에서도 받아오지 않아도 좋을 것 같은데 어떻게 생각하시나용?

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

앗 그러네요 ,,, 수정할게요 !

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

확인했습니다 본 thread 는 resolve 하겟습니다!

Comment thread src/constants/pagination.js
import React, { useState, useEffect } from "react";
import { defaultFadeInVariants, staggerHalf, staggerQuarter } from "styles/motions";
import { filterProps, motion } from "framer-motion";
import { motion } from "framer-motion";

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

지금 보니까 이 motion 도 아래에서 안 쓰이는 것 같은데 확인 한번 해 주실 수 있나용 이건 아마 제가 import 해둔거같긴한데... ㅜ.ㅜ 헛헛

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

저도 처음에 그런 줄 알고 지웠다가 오류가 나서 봤더니 motion.div에서 쓰이는 것 같더라구요 ,,,,

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

앗 맞네요 밑에 <motion.div> 가 있네요..헛헛 😅 코드 가 접혀져서 못 봤나보네요 죄송함니다...ㅋㅋ

Comment thread src/pages/Leaderboard/index.js Outdated
Comment thread src/pages/Leaderboard/index.js Outdated
{ranks.length !== 0 && (
<>
<LeaderBoard ranks={(pageNumber == 1) ? ranks.slice(2) : ranks} pageNumber={pageNumber} pageSize={pageSize}></LeaderBoard>
<LeaderBoard ranks={(pageNumber === 1) ? ranks.slice(2) : ranks} pageNumber={pageNumber} pageSize={LEADERBOARD_PAGE_SIZE}></LeaderBoard>

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

API 에 이제 ranking 이 추가되어서 요기 이제 pageNumberpageSize 넘기지 않아도 되지 않을까용?

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

네네 안 남겨도 될 것 같습니다

Comment thread src/pages/Login/index.js
@jaychang99

Copy link
Copy Markdown
Member

늦은 시간에도 고생하셨습니다! 추가적인 부분도 comment 달아놓았습니다!

@xhmxnjxx

Copy link
Copy Markdown
Collaborator Author

늦은 시간에도 고생하셨습니다! 추가적인 부분도 comment 달아놓았습니다!

src/pages/Login/index.js 에서 try-catch 부분 제외하고 수정 완료해서 push 해두었습니다!

@xhmxnjxx
xhmxnjxx requested a review from jaychang99 November 19, 2022 18:54

@jaychang99 jaychang99 left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

LGTM 😄 수고많으셨씁니다!

import React, { useState, useEffect } from "react";
import { defaultFadeInVariants, staggerHalf, staggerQuarter } from "styles/motions";
import { filterProps, motion } from "framer-motion";
import { motion } from "framer-motion";

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

앗 맞네요 밑에 <motion.div> 가 있네요..헛헛 😅 코드 가 접혀져서 못 봤나보네요 죄송함니다...ㅋㅋ

ranks.map((rank, index) => (
<LeaderBoardItem
rank={(pageNumber == 1) ? index + 1 + TOP_DISPLAY_USER : index + 1 + pageSize}
rank={rank.ranking}

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

확인했습니다 본 thread 는 resolve 하겟습니다!

Comment thread src/pages/Leaderboard/index.js Outdated
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

feature 기능 추가

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants