Skip to content
This repository was archived by the owner on Jun 23, 2026. It is now read-only.
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
23 commits
Select commit Hold shift + click to select a range
72dffc5
python 상수 오탈자 수정
xhmxnjxx Nov 17, 2022
3e18e6d
html 상수 오탈자 수정
xhmxnjxx Nov 17, 2022
a5da9b8
c 상수 오탈자 수정
xhmxnjxx Nov 17, 2022
8fc1331
로그인 된 상태에서 로그인 화면 접속 시도 시 메인 화면으로 redirect 하는 기능 구현
xhmxnjxx Nov 17, 2022
9313565
Leaderboard Pagination 전체 페이지 구현
xhmxnjxx Nov 17, 2022
4d5db8d
리더보드 페이지 페이지네이션 API 연결 구현
xhmxnjxx Nov 18, 2022
4796142
fix: Change || to ?? operator
hajeong-lim Nov 18, 2022
b87ca20
랭킹보드에서 2페이지 넘어갈 시 Leaderboard 순위 버그 수정
xhmxnjxx Nov 18, 2022
2968d6e
fix: Remove unnecessary theme imports
hajeong-lim Nov 18, 2022
1d56863
fix: Rename PortalModal/style.js to styles.js
hajeong-lim Nov 18, 2022
05a55c8
fix: Move common styles in PortalModal to component/common/styles.js
hajeong-lim Nov 18, 2022
e1361ed
fix: Fix Modal style imports
hajeong-lim Nov 18, 2022
581e50d
fix: Renmae style.js to styles.js
hajeong-lim Nov 19, 2022
a1624df
fix: Chagne import path in PortalModal
hajeong-lim Nov 19, 2022
8c0c397
Merge pull request #24 from jaychang99/Feature_#11_Modal_issues
hajeong-lim Nov 19, 2022
4faedc4
LEADERBOARD_PAGE_SIZE 상수 처리
xhmxnjxx Nov 19, 2022
72c4ef3
API 구조 변경에 따른 코드 변경 및 develop branch merge conflict 처리
xhmxnjxx Nov 19, 2022
88675b0
const {offset, setOffset} 삭제
xhmxnjxx Nov 19, 2022
8932ecb
주석 처리
xhmxnjxx Nov 19, 2022
d774186
.env 파일 추가
xhmxnjxx Nov 19, 2022
6186ea3
Merge branch 'Feature_Issue#11_Leaderboard_Pagination_API' of https:/…
xhmxnjxx Nov 19, 2022
82c0e44
Leaderboard props에서 pageNumber, pageSize 삭제
xhmxnjxx Nov 19, 2022
8604015
console.log 부분 삭제
xhmxnjxx Nov 19, 2022
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .env
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
REACT_APP_API_ENDPOINT = https://api.tadak.dev
5 changes: 2 additions & 3 deletions src/components/LanguageCard/styles.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import styled from "@emotion/styled";
import { theme } from "styles/theme";
import { BadgeIconContainer } from "components/common/Badge/styles";

export const CardContainer = styled.div`
Expand All @@ -19,7 +18,7 @@ export const IconContainer = styled(BadgeIconContainer)`
justify-content: center;
align-items:center;

background-color:${theme.color.white};
background-color:${({ theme }) => theme.color.white};
border-radius:10px;
width:64px;
height:64px;
Expand Down Expand Up @@ -53,5 +52,5 @@ export const Summary = styled.div`
font-weight: 400;
font-size: 12px;

color: ${theme.color.white};
color: ${({ theme }) => theme.color.white};
`;
4 changes: 2 additions & 2 deletions src/components/LeaderBoard/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -37,11 +37,11 @@ function LeaderBoard({ ranks }) {
{ranks &&
ranks.map((rank, index) => (
<LeaderBoardItem
rank={index + 1 + TOP_DISPLAY_USER}
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 하겟습니다!

variants={defaultFadeInScaleVariants}
username={rank.user.username}
email={rank.user.email}
KPM={rank.record}
KPM={rank.highest_record}
language={rank.language_no}
syntax={rank.grammar_no}
key={index}
Expand Down
2 changes: 1 addition & 1 deletion src/components/PortalModal/index.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import {
StyledModal,
DimmedArea,
} from "components/PortalModal/style";
} from "components/PortalModal/styles";
import { createPortal } from "react-dom";
import { useState, useEffect } from "react";
import usePreventScroll from "hooks/usePreventScroll";
Expand Down
83 changes: 0 additions & 83 deletions src/components/PortalModal/style.js

This file was deleted.

39 changes: 39 additions & 0 deletions src/components/PortalModal/styles.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
import styled from "@emotion/styled/macro";
import { hexToRgba } from "utils/color";
import { motion } from "framer-motion";

export const StyledModal = styled(motion.div)`
display: flex;
flex-direction: column;
justify-content: center;
align-items: center;
font-size: 14px;
gap: 16px;
border-radius: 10px;
padding: 40px 20px;
position: fixed;
top: 50%;
left: 50%;
transform: translate(-50%, -50%);
z-index: 100;
width: 400px;
background: ${({ theme }) => theme.color.modalBG};
box-shadow: 0px 4px 4px rgba(0, 0, 0, 0.25);
`;

export const DimmedArea = styled.div`
position: fixed;
top: 0;
left: 0;

display: flex;
justify-content: center;
align-items: center;

width: 100%;
height: 100%;

background-color: ${({ theme }) => hexToRgba(theme.color.white, 0.2)};

z-index: 1000;
`;
2 changes: 1 addition & 1 deletion src/components/Timer/index.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import React from "react";
import { useState, useEffect } from "react";
import { DigitText, SymbolText, TimerDiv } from "./style";
import { DigitText, SymbolText, TimerDiv } from "components/Timer/styles";

// EXAMPLE
// const [stopState, setStopState] = useState(false);
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import styled from "@emotion/styled/macro";
import { theme } from "styles/theme";
export const TimerDiv = styled.div`
display: flex;
flex-direction: row;
Expand All @@ -11,11 +10,11 @@ border-radius: 20px;
background: #161B21
`

const baseText=styled.div`
const baseText = styled.div`
font-style: normal;
font-weight: 400;
font-size: 48px;
color: ${theme.color.white};
color: ${({ theme }) => theme.color.white};
`

export const DigitText = styled(baseText)`
Expand Down
5 changes: 2 additions & 3 deletions src/components/TypeInput/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,7 @@ import { useLocation } from "react-router-dom";
import { serverAxios } from "utils/commonAxios";
import PortalModal from "components/PortalModal";
import Button from "components/common/Button";
import { ModalBody, ModalButton, ModalHeader, ModalIcon, ModalTitle } from "components/PortalModal/style";
import { theme } from "styles/theme";
import { ModalBody, ModalButton, ModalHeader, ModalIcon, ModalTitle } from "components/common/styles";
import TimerIcon from "assets/svgs/Tumer_light.svg";

function generateLetterStatus(currentInputString, letter, currentLetterIndex) {
Expand Down Expand Up @@ -266,7 +265,7 @@ function TypeInput({ timePassed, setCurrentKPM, currentKPM, setIsPlaying, paragr
open={showCountdownModal}
onClose={() => { }}
>
<ModalHeader color={theme.color.blue.light}>준비하세요!</ModalHeader>
<ModalHeader color={({ theme }) => theme.color.blue.light}>준비하세요!</ModalHeader>
<ModalTitle>{countDownSeconds}</ModalTitle>
<ModalButton onClick={() => { setIsReady(false) }}>바로시작!</ModalButton>
</PortalModal>
Expand Down
45 changes: 45 additions & 0 deletions src/components/common/styles.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
import styled from "@emotion/styled/macro";

// TODO: 일단 Modal에서만 사용하는 스타일임, Modal 이외의 style에서도 활용가능하도록 일반화
export const ModalIcon = styled.img`
width:40px;
height:40px;
`

export const ModalText = styled.div`
color: ${({ theme, color }) => color ?? theme.color.white};
`

export const ModalTitle = styled(ModalText)`
font-size: 40px;
font-weight: 700;
`

export const ModalHeader = styled(ModalText)`
font-size: 36px;
font-weight: 700;
`

export const ModalBody = styled(ModalText)`
font-size: 16px;
`

export const ModalButton = styled.div`
padding: 10px;
width: 100%;
background-color: #bfcdf0;
border-radius: 10px;
cursor: pointer;
font-size: 16px;
color: #26262d;
text-align: center;
font-weight: bold;
&.active {
background-color: ${({ theme }) => theme.color.primary500};
}

&:hover {
background-color: ${({ theme }) => theme.color.primary200};
}
transition: 0.3s;
`
1 change: 1 addition & 0 deletions src/constants/pagination.js
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export const LEADERBOARD_PAGE_SIZE = 10;
Comment thread
jaychang99 marked this conversation as resolved.
18 changes: 9 additions & 9 deletions src/constants/paragraphs.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions src/hooks/useRanks.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ function useRanks(pageNumber, pageSize, languageNo = 1, grammarNo = 1) {

return {
ranks: data?.ranks,
ranks_meta: data?.ranks_meta,
error,
mutate, // 데이터 변경 시 이 API 를 이용하는 모든 컴포넌트에 UI 업데이트 방송.
};
Expand Down
Loading