Skip to content

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

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

Open
wants to merge 23 commits into
base: develop
Choose a base branch
from

Conversation

xhmxnjxx
Copy link
Collaborator

@xhmxnjxx xhmxnjxx commented Nov 18, 2022

Related to #11

체크 리스트

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

작업 내역

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

비고

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

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

vercel bot commented Nov 18, 2022

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
'<!DOCTYPE html>\n<html lang="en">\n <head>\n <title>HTML from Tag</title>\n </head>\n <body>\n <form action="actionFile.php" method="get">\n First name:\n <input type="text" name="first_name" value="" maxlength="100" />\n <br />\n Last name:\n <input type="text" name="last_name" value="" maxlength="100" />\n <input type="submit" value="Submit" />\n </form>\n </body>\n</html>',
'<!DOCTYPE html>\n<html lang="en">\n <head>\n <title>Table Sample</title>\n </head>\n <body>\n <table border="1">\n <tbody>\n <tr>\n <td>first cell</td>\n <td>second cell</td>\n </tr>\n <tr>\n <td>third cell</td>\n <td>fourth cell</td>\n </tr>\n </tbody>\n </table>\n </body>\n</html>',

// 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
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
Collaborator Author

Choose a reason for hiding this comment

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

네네 수정해보겠습니다!

const [offSet, setOffSet] = useState(2);


const topRanks = useRanks(1, pageSize, languageNo, grammarNo).ranks;
Copy link
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
Collaborator Author

Choose a reason for hiding this comment

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

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

@@ -37,11 +37,11 @@ function LeaderBoard({ ranks, pageNumber, pageSize }) {
{ranks &&
ranks.map((rank, index) => (
<LeaderBoardItem
rank={(pageNumber == 1) ? index + 1 + TOP_DISPLAY_USER : index + 1 + pageSize}
rank={rank.ranking}
Copy link
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
Collaborator Author

Choose a reason for hiding this comment

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

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

Copy link
Member

Choose a reason for hiding this comment

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

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

@@ -8,7 +8,7 @@ import {
} from "pages/Leaderboard/styles";
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
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
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
Member

Choose a reason for hiding this comment

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

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

<>
<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
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
Collaborator Author

Choose a reason for hiding this comment

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

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

@jaychang99
Copy link
Member

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

@xhmxnjxx
Copy link
Collaborator Author

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

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

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

@jaychang99 jaychang99 left a comment

Choose a reason for hiding this comment

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

LGTM 😄 수고많으셨씁니다!

@@ -8,7 +8,7 @@ import {
} from "pages/Leaderboard/styles";
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
Member

Choose a reason for hiding this comment

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

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

@@ -37,11 +37,11 @@ function LeaderBoard({ ranks, pageNumber, pageSize }) {
{ranks &&
ranks.map((rank, index) => (
<LeaderBoardItem
rank={(pageNumber == 1) ? index + 1 + TOP_DISPLAY_USER : index + 1 + pageSize}
rank={rank.ranking}
Copy link
Member

Choose a reason for hiding this comment

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

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature 기능 추가
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants