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

[GGFE-44] Style Rank Trophy #807

Merged
merged 49 commits into from
Jun 15, 2023
Merged
Show file tree
Hide file tree
Changes from 71 commits
Commits
Show all changes
49 commits
Select commit Hold shift + click to select a range
ff9e49c
[Feat] [GGFE-44] rank matchmodeํƒ€์ž…์— ๋งž๊ฒŒ ์ˆ˜์ •
May 31, 2023
0b7cb15
[Feat] [GGFE-44] rank togglemode์— ๋งž๊ฒŒ ์ˆ˜์ • ๋ฐ myrank -1๋กœ ๋ณ€๊ฒฝ
May 31, 2023
740b697
[Feat] [GGFE-44] rank togglemode์— ๋งž๊ฒŒ ์ˆ˜์ • ๋ฐ myrank -1๋กœ ๋ณ€๊ฒฝ
Jun 1, 2023
b1a8fc9
[Style] [GGFE-44] rank trophy ์ถ”๊ฐ€
Jun 1, 2023
d131d65
[Style] [GGFE-44] ๋žญํ‚นํŽ˜์ด์ง€์—์„œ tropy์ถ”๊ฐ€, api ์ˆ˜์ •์— ๋”ฐ๋ฅธ ํƒ€์ž…,url๋ณ€๊ฒฝ
Jun 1, 2023
92b004f
[Feat] [GGFE-44] ๋žญํ‚นํŽ˜์ด์ง€ ํŠธ๋กœํ”ผ ์‹œ์ฆŒ๋ณ€๊ฒฝ, ๋žญํฌ ๋ณ€๊ฒฝ์‹œ ๋žญ์ปค๋ณ€๊ฒฝ
Jun 1, 2023
b5780f1
[Style] [GGFE-44] ์œ„์น˜ ํฌ๊ธฐ ์ƒ‰์ƒ ๋ณ€๊ฒฝ
Jun 2, 2023
ff60165
Merge branch 'GGFE-42-Rank-List' into GGFE-47-Style-Rank-Normal-Chart
Jun 2, 2023
346a2a1
[Style] [GGFE-47] ์ฐจํŠธ ์Šคํƒ€์ผ ์ ์šฉ
Jun 2, 2023
c233f79
[Style] [GGFE-44] ๋นต๋น ๋ ˆ ํšจ๊ณผ ์ ์šฉ
Jun 2, 2023
e80ee80
[Feat] [GGFE-44] ranklist ๋กœ์ง์ˆ˜์ •
Jun 2, 2023
c78eaa6
[Style] [GGFE-47] ์ฐจํŠธ๋ฆฌ์ŠคํŠธ normal myrank ranktitle ์ ์šฉ
Jun 5, 2023
a3aa065
[Style] [GGFE-44] ์ฑ”ํ”ผ์–ธ ์‚ญ์ œ ํ›„ ์œ„์น˜ ๋ณ€๊ฒฝ
Jun 5, 2023
74b82dc
[Style] [GGFE-44] rankpage ํ”ผ๊ทธ๋งˆ์— ๋งž๊ฒŒ ์งง๊ฒŒ ์กฐ์ ˆ
Jun 5, 2023
e720d56
[Style] [GGFE-44] ์ฃผ์„ ์ œ๊ฑฐ
Jun 5, 2023
7708a81
[Feat] [GGFE-44] ํ† ๊ธ€๋ฒ„ํŠผ์— ๋”ฐ๋ผ ์ƒ‰์ƒ๋ฒˆ๊ฒฝ ๋นต๋น ๋ ˆ 5๊ฐœ๋กœ ๋ณ€๊ฒฝ ์‹œ์ฆŒ๋ฆฌ์ŠคํŠธ ๋””์ž์ธ z-index๋ณ€๊ฒฝ
Jun 7, 2023
02916cf
[Chor] [GGFE-44] togglemodecontext ํƒ€์ž… ๋Œ€๋ฌธ์ž๋กœ ๋ณ€๊ฒฝ
Jun 7, 2023
d1de6ee
[Style] [GGFE-47] ์œ„์น˜ ์ˆ˜์ •, ํฐํŠธ์ˆ˜์ •, ์ฃผ์„ ์ œ๊ฑฐ
Jun 7, 2023
d11a2de
[Chore] ์ฃผ์„์ œ๊ฑฐ
Jun 7, 2023
a59343e
[Chore] [GGFE-44] gameresultbit ๋ณ€๊ฒฝ์— ๋”ฐ๋ผ ์ƒˆ๋กœ์šด ranktropy ์ถ”๊ฐ€
Jun 7, 2023
d3405ff
[Style] [GGFE-44] background-image ์ƒ‰์ƒ ๋ณ€๊ฒฝ
Jun 7, 2023
8eef93b
[Fix] [GGFE-62] ๋žญํฌ ํƒ€์ž… ๊ด€๋ จ์ˆ˜์ •
Jun 8, 2023
559098f
[Chore] [GGFE-62] ์ฃผ์„ ์ œ๊ฑฐ
Jun 8, 2023
184113c
[Style] [GGFE-47] ์ผ๋ฐ˜๋žญํ‚น ์ƒ‰์ƒ ๋ณ€๊ฒฝ
Jun 10, 2023
ad02c99
[Fix] [GGFE-62] myrank css์˜ค๋ฅ˜ ์ˆ˜์ •
Jun 10, 2023
7248fe3
Merge branch 'GGFE-00/Feat/api-refactoring' into GGFE-44-Style-Rank-Tโ€ฆ
parksangmin1543 Jun 12, 2023
9d8e3a6
[Style] [GGFE-44] ๋นต๋น ๋ ˆ ๋ฐ์ดํ„ฐ ์—†์„์‹œ ์•ˆ๋œจ๊ฒŒ ๋ณ€๊ฒฝ
Jun 12, 2023
1a63e76
Merge branch 'GGFE-62-rank-api-type-bug' into GGFE-44-Style-Rank-Trophy
Jun 12, 2023
b530cd9
[Fix] [GGFE-44] rank ํƒ€์ž… ๋ฒ„๊ทธ์ˆ˜์ •
Jun 12, 2023
ceb4fe4
[Style] [GGFE-44] z-index์ˆ˜์ •
Jun 12, 2023
e25cec5
[Style] [GGFE-44] z-index์ˆ˜์ •
Jun 12, 2023
a74658f
Update RankList.tsx
parksangmin1543 Jun 12, 2023
cc2e73a
Merge branch 'GGFE-46-Style-Game-Result-List' into GGFE-44-Style-Rankโ€ฆ
Jun 12, 2023
9784524
Revert "Update RankList.tsx"
Jun 12, 2023
3c03283
Revert "Merge branch 'GGFE-46-Style-Game-Result-List' into GGFE-44-Stโ€ฆ
Jun 12, 2023
ae403e1
[Feat] [GGFE-44] mergeํ›„ myrank z-index์ˆ˜์ •
Jun 12, 2023
07fa591
[Chore] [GGFE-44] console.log ์ œ๊ฑฐ
Jun 12, 2023
68e3671
[Chore] [GGFE-44] ์ฃผ์„์ œ๊ฑฐ
Jun 12, 2023
7e9555f
[Style] [GGFE-44] ๋ชจ๋ฐ”์ผ ํ™˜๊ฒฝ์ผ๋•Œํฌ๊ธฐ ๊ฐ’ ์กฐ์ •
Jun 13, 2023
4406e76
[Style] [GGFE-44] ๋ชจ๋ฐ”์ผ ํ™˜๊ฒฝ์ผ๋•Œํฌ๊ธฐ ๊ฐ’ ์กฐ์ •
Jun 13, 2023
2de350b
[Style] [GGFE-44] myrank ๋ฐ์ดํ„ฐ ์—†์„๋•Œ ๋””์ž์ธ ๋ณ€๊ฒฝ, ์Šคํฌ๋กค trophy๋กœ ์ธํ•ด ์ƒ๊ธด ๋ฌธ์ œ ์ˆ˜์ •
Jun 13, 2023
b0ce1e4
[Style] [GGFE-44] ๋นต๋น ๋ ˆ ํšจ๊ณผ rem-> %๋กœ ๋ณ€๊ฒฝ
Jun 13, 2023
9b7fbb2
[Style] [GGFE-44] intraId ์ƒ‰์ƒ๋ฐํ…Œ๋‘๋ฆฌ๋ณ€๊ฒฝ
Jun 13, 2023
513222f
[Chore] [GGFE-44] ํƒ€์ž… ๋ณ€๊ฒฝ
Jun 13, 2023
9eaec10
Merge branch 'GGFE-60-Set-up-Storybook' into GGFE-44-Style-Rank-Trophy
Jun 14, 2023
9179c4b
[Feat] [GGFE-44] ranker์— ๋ฐ์ดํ„ฐ๊ฐ€ ์—†์„ ๊ฒฝ์šฐ ๋ฌผ์Œํ‘œ๊ฐ€ ๋‚˜์˜ค๊ฒŒ ๋ณ€๊ฒฝ, rankํƒ€์ž… ๋ณ€๊ฒฝ, ์Šคํ† ๋ฆฌ๋ถ ์ถ”๊ฐ€
Jun 15, 2023
49d56ba
Merge branch 'GGFE-00/Feat/api-refactoring' into GGFE-44-Style-Rank-Tโ€ฆ
parksangmin1543 Jun 15, 2023
79c0af4
[Style] [GGFE-44] ์Šคํƒ€์ผ๋ฒ„ํŠผ ์„œ์น˜๋ฐ” z-index๊ฐ’ ๋ณ€๊ฒฝ
Jun 15, 2023
e2818d2
[Fix] [GGFE-44] img priority & package-lock
Jun 15, 2023
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
2 changes: 1 addition & 1 deletion components/main/Section.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ type pathType = {
export default function xSection({ path }: SectionProps) {
const pathCheck: pathType = {
game: <GameResult />,
rank: <RankList toggleMode={'rank'} isMain={true} />,
rank: <RankList toggleMode={'RANK'} isMain={true} />,
};

return (
Expand Down
10 changes: 2 additions & 8 deletions components/mode/modeItems/ModeToggle.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,17 +2,11 @@ import styles from 'styles/mode/ModeToggle.module.scss';

interface ModeToggleProps {
id: string;
text: string;
checked: boolean;
onToggle: () => void;
}

export default function ModeToggle({
id,
text,
checked,
onToggle,
}: ModeToggleProps) {
export default function ModeToggle({ id, checked, onToggle }: ModeToggleProps) {
return (
<div>
<input
Expand All @@ -24,7 +18,7 @@ export default function ModeToggle({
hidden
/>
<label htmlFor={id} className={styles.toggleSwitch}>
<span className={styles.toggleText}>{text}</span>
<span className={styles.toggleText}></span>
<span className={styles.toggleButton}></span>
</label>
</div>
Expand Down
12 changes: 3 additions & 9 deletions components/mode/modeWraps/RankModeWrap.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -12,14 +12,9 @@ interface RankModeWrapProps {
}

export default function RankModeWrap({ children, setMode }: RankModeWrapProps) {
const { seasonList, season, seasonDropDownHandler, seasonMode } =
useSeasonDropDown();
const { onToggle, Mode } = useModeToggle(
seasonMode === 'NORMAL' ? 'NORMAL' : 'RANK'
);
const [showSeasons, setShowSeasons] = useState<boolean>(
seasonMode !== 'NORMAL'
);
const { seasonList, season, seasonDropDownHandler } = useSeasonDropDown();
const { onToggle, Mode } = useModeToggle('RANK');
const [showSeasons, setShowSeasons] = useState<boolean>(true);

useEffect(() => {
setShowSeasons(Mode === 'RANK');
Expand All @@ -32,7 +27,6 @@ export default function RankModeWrap({ children, setMode }: RankModeWrapProps) {
<ModeToggle
checked={Mode === 'RANK'}
onToggle={onToggle}
text={Mode === 'RANK' ? '๋žญํฌ' : '์—ด์ •'}
id={'rankToggle'}
/>
{showSeasons && seasonList && (
Expand Down
21 changes: 9 additions & 12 deletions components/rank/MyRank.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,27 +3,24 @@ import { myRankState, scrollState } from 'utils/recoil/myRank';
import styles from 'styles/rank/RankList.module.scss';
import { ToggleMode } from 'types/rankTypes';

export default function MyRank(toggleMode: ToggleMode) {
interface MyRankProp {
toggleMode: ToggleMode;
}

export default function MyRank(prop: MyRankProp) {
const { toggleMode } = prop;
const myRank = useRecoilValue(myRankState);
const setIsScroll = useSetRecoilState(scrollState);
const rankType = toggleMode === 'RANK' ? '๋žญํฌ' : '์—ด์ •';
const rankType = toggleMode === 'RANK' ? 'rank' : 'vip';
const isRanked = myRank[toggleMode] === -1 ? 'unrank' : 'RANK';
const content = {
unrank: {
style: '',
message: [
`๐Ÿ’ก ๋‚˜์˜ ${
rankType + (toggleMode === 'RANK' ? '๊ฐ€' : '์ด')
} ์ •ํ•ด์ง€์ง€ ์•Š์•˜์Šต๋‹ˆ๋‹ค ๐Ÿ’ก`,
],
message: [`My ${rankType}:`, ` ---`],
},
RANK: {
style: styles.rank,
message: [
`๐Ÿš€๐Ÿš€ ๋‚˜์˜ ${rankType}`,
` ${myRank[toggleMode]}์œ„`,
' ๋ฐ”๋กœ๊ฐ€๊ธฐ ๐Ÿš€๐Ÿš€',
],
message: [`My ${rankType}:`, ` ${myRank[toggleMode]}`],
},
};

Expand Down
58 changes: 37 additions & 21 deletions components/rank/RankList.tsx
Original file line number Diff line number Diff line change
@@ -1,22 +1,22 @@
import { useState } from 'react';
import { RankUser, NormalUser, Rank, ToggleMode } from 'types/rankTypes';
import React, { useState, createContext } from 'react';
import { RankUser, NormalUser, Rank } from 'types/rankTypes';
import RankListMain from './topRank/RankListMain';
import RankListFrame from './RankListFrame';
import RankListItem from './RankListItem';
import useRankList from 'hooks/rank/useRankList';
import { ToggleMode } from 'types/rankTypes';

interface RankListProps {
toggleMode: ToggleMode;
season?: number;
isMain?: boolean;
}
export default function RankList({
toggleMode,
season,
isMain = false,
}: RankListProps) {
const seasonMode = 'RANK';
export const ToggleModeContext = createContext<'RANK' | 'NORMAL'>('RANK');

export default function RankList(prop: RankListProps) {
Copy link
Contributor

Choose a reason for hiding this comment

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

์ด ๋ถ€๋ถ„์€ {toggleMode, season, isMain}: RankListProps๋กœ ์ธ์ž ์•ˆ์—์„œ ๊ตฌ์กฐ๋ถ„ํ•ดํ•ด๋„ ๋  ๊ฒƒ ๊ฐ™์•„์š”!

const { toggleMode, season, isMain } = prop;
const [rank, setRank] = useState<Rank>();
const [ranker, setRanker] = useState<Rank>();
const [page, setPage] = useState<number>(1);
const pageInfo = {
currentPage: rank?.currentPage,
Expand All @@ -29,33 +29,49 @@ export default function RankList({
targetMode !== 'NORMAL' ? 'ranks/single' : 'exp';
const seasonQuery = toggleMode === 'RANK' ? `&season=${season}` : '';
return isMain
? `/pingpong/${modeQuery(seasonMode)}?page=1&size=3`
: `/pingpong/${modeQuery(toggleMode)}?page=${page}${seasonQuery}`;
? `/pingpong/${modeQuery(toggleMode)}?page=1&size=3`
: `/pingpong/${modeQuery(toggleMode)}?page=${page}&size=20${seasonQuery}`;
};
const makePathRanker = (): string => {
const modeQuery = (targetMode?: string) =>
targetMode !== 'NORMAL' ? 'ranks/single' : 'exp';
const seasonQuery = toggleMode === 'RANK' ? `&season=${season}` : '';
return isMain
? `/pingpong/${modeQuery(toggleMode)}?page=1&size=3`
: `/pingpong/${modeQuery(toggleMode)}?page=1&size=3${seasonQuery}`;
};

useRankList({
makePath: makePath(),
makePathRanker: makePathRanker(),
toggleMode: toggleMode,
season: season,
setRank: setRank,
setRanker: setRanker,
page: page,
setPage: setPage,
pageInfo: pageInfo,
});

if (isMain) return <RankListMain rank={rank} />;
if (isMain) {
return <RankListMain rank={ranker} isMain={true} />;
}

return (
<RankListFrame toggleMode={toggleMode} pageInfo={pageInfo}>
{rank?.rankList.map((item: NormalUser | RankUser, index) => (
<RankListItem
key={index}
index={index}
toggleMode={toggleMode}
user={makeUser(item)}
/>
))}
</RankListFrame>
<ToggleModeContext.Provider value={toggleMode}>
<div>
<RankListMain rank={ranker} isMain={false} />
<RankListFrame toggleMode={toggleMode} pageInfo={pageInfo}>
{rank?.rankList.map((item: NormalUser | RankUser, index) => (
<RankListItem
key={index}
toggleMode={toggleMode}
user={makeUser(item)}
Copy link
Contributor

Choose a reason for hiding this comment

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

makeUser์˜ ๋ฐ˜ํ™˜๊ฐ’๋„ ํƒ€์ž… ์ง€์ •ํ•ด์ฃผ๋ฉด RankListItem์—์„œ ํƒ€์ž… ๊ฒฝ๊ณ  ์—†์–ด์งˆ ๋“ฏ ํ•ฉ๋‹ˆ๋‹ค!

/>
))}
Comment on lines +68 to +74
Copy link
Member

Choose a reason for hiding this comment

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

๋งŒ์•ฝ์— rank ๋ฐฐ์—ด์˜ ์›์†Œ๊ฐ€ 3๊ฐœ ๋ฏธ๋งŒ์ด๋ฉด ์–ด๋–ป๊ฒŒ ๋˜๋‚˜์š”? ์ €๋ฒˆ์— ์‹œ์ฆŒ ์ƒˆ๋กœ ๋งŒ๋“ค์—ˆ์„ ๋•Œ ์ˆœ์œ„๊ฐ€ 2๋“ฑ๊นŒ์ง€์ธ๊ฐ€ ๋ฐ–์— ์—†์—ˆ๋˜ ๊ฒƒ์„ ๋ณธ ์ ์ด ์žˆ์—ˆ๋Š”๋ฐ ๊ทธ๋•Œ๋Š” ๊ทธ๋ƒฅ ๋น„์–ด์žˆ์—ˆ๋˜ ๊ฒƒ ๊ฐ™์•„์„œ์š”. ์ง€๊ธˆ์€ ์–ด๋–ป๊ฒŒ ์ฒ˜๋ฆฌ๋˜์–ด์žˆ๋‚˜ ๋ณด๊ณ ์‹ถ๊ธด ํ•œ๋ฐ ๋ณผ ๋ฐฉ๋ฒ•์ด ์—†๋„ค์š”... (์ด๋ ‡๊ฒŒ ์ง์ ‘ ํ™•์ธํ•ด๋ณด๊ธฐ ์–ด๋ ค์šด ๊ฒฝ์šฐ์—๋Š” story ๋งŒ๋“ค์–ด์ฃผ์‹œ๋ฉด ์ข‹์„ ๊ฒƒ ๊ฐ™์•„์š” ๐Ÿ‘)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

๋ฐฐ์—ด์ด ๋ถ€๋ถ„์ ์œผ๋กœ ์—†์„๊ฒฝ์šฐ , ์•„์˜ˆ์—†์„๊ฒฝ์šฐ ๋ฌผ์Œํ‘œ๋‚˜์˜ค๊ฒŒ ์ฒ˜๋ฆฌํ–ˆ์Šต๋‹ˆ๋‹ค. ์Šคํ† ๋ฆฌ๋Š” 1,2,3๋“ฑ ๋ฐ์ดํ„ฐ์—†์„๋•Œ ์—๋Ÿฌ๊ฐ€ ๋– ์„œ 3๋“ฑ๋งŒ ์—†์„๊ฒฝ์šฐ๋งŒ ํ™•์ธํ–ˆ์Šต๋‹ˆ๋‹ค.

</RankListFrame>
</div>
</ToggleModeContext.Provider>
);
}

Expand Down
20 changes: 9 additions & 11 deletions components/rank/RankListItem.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -13,24 +13,22 @@ interface User {
}

interface RankListItemProps {
index: number;
user: User;
toggleMode: ToggleMode;
}

export default function RankListItem({
index,
user,
toggleMode,
}: RankListItemProps) {
export default function RankListItem({ user, toggleMode }: RankListItemProps) {
const { rank, intraId, statusMessage, point, level } = user;
const myIntraId = useRecoilValue(userState).intraId;
const wrapStyle = {
evenOdd: index % 2 === 0 ? styles.even : styles.odd,
topStandard: rank < 4 ? styles.top : styles.standard,
Copy link
Member

Choose a reason for hiding this comment

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

์—ฌ๊ธฐ์„œ ์—๋Ÿฌ๋‚˜๋Š”๋ฐ ํ™•์ธํ•ด์ฃผ์‹ค ์ˆ˜ ์žˆ๋‚˜์š”? rank์˜ ํƒ€์ž…์ด string | number๋ผ์„œ < ์—ฐ์‚ฐ์ž๋ฅผ ์‚ฌ์šฉํ•  ์ˆ˜ ์—†๋‹ค๋Š” ๊ฒƒ ๊ฐ™์•„์š”...!
์•„๋งˆ string์ธ ๊ฒฝ์šฐ์—๋Š” styles.standard๊ฐ€ ์ ์šฉ๋˜์—ˆ๋˜ ๊ฒƒ ๊ฐ™์€๋ฐ, rank๊ฐ€ string์ธ ๊ฒฝ์šฐ๊ฐ€ ์ž˜ ๊ณ ๋ ค๋˜๊ณ  ์žˆ๋Š”์ง€ (์• ์ดˆ์— rank๊ฐ€ string์ผ ํ•„์š”๊ฐ€ ์žˆ๋Š”์ง€?) ํ™•์ธํ•ด๋ด์•ผ ํ•  ๊ฒƒ ๊ฐ™์Šต๋‹ˆ๋‹ค!

Copy link
Contributor Author

Choose a reason for hiding this comment

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

ranklist ๋ฐ์ดํ„ฐ๋ฅผ ์ „์—๋Š” ๊ฐ€์ž…ํ•œ ๋ชจ๋“  ๋ถ„๋“ค์„ ๋ฐ›์•„์™€ ํ•œ๋ฒˆ๋„ ์•ˆํ–ˆ์„๊ฒฝ์šฐ์—๋„ ๋žญํ‚น์— '-'์ด๋ ‡๊ฒŒ ํ‘œ์‹œํ•˜๊ธฐ ์œ„ํ•ด์„œ ์‚ฌ์šฉํ–ˆ์—ˆ์Šต๋‹ˆ๋‹ค. ํ˜„์žฌ๋Š” ํ•„์š”์—†์–ด์„œ ์ˆ˜์ •ํ–ˆ์Šต๋‹ˆ๋‹ค.

rankItem: {
RANK: styles.Ranking,
NORMAL: styles.Vip,
},
myRankItem: {
rank: intraId === myIntraId && level === null ? styles.myRanking : '',
normal: intraId === myIntraId && level !== null ? styles.myVip : '',
RANK: intraId === myIntraId && level === null ? styles.myRanking : '',
NORMAL: intraId === myIntraId && level !== null ? styles.myVip : '',
},
};

Expand All @@ -45,8 +43,8 @@ export default function RankListItem({

return (
<div
className={`${styles.rankItemWrap} ${wrapStyle.evenOdd}
${wrapStyle.topStandard} ${wrapStyle.myRankItem[toggleMode]}`}
className={`${styles.rankItemWrap} ${wrapStyle.topStandard}
${wrapStyle.myRankItem[toggleMode]} ${wrapStyle.rankItem[toggleMode]}`}
>
{rank}
<div className={styles.intraId}>{makeIntraIdLink()}</div>
Expand Down
60 changes: 41 additions & 19 deletions components/rank/topRank/RankListItemMain.tsx
Original file line number Diff line number Diff line change
@@ -1,35 +1,57 @@
import Link from 'next/link';
import React, { useContext } from 'react';
import { RankUser, NormalUser } from 'types/rankTypes';
import styles from 'styles/rank/RankListMain.module.scss';

import PlayerImage from 'components/PlayerImage';
import { ToggleModeContext } from '../RankList';
interface RankListItemMainProps {
user: NormalUser | RankUser;
isSeasonNormal: boolean;
}

export default function RankListItemMain({
user,
isSeasonNormal,
}: RankListItemMainProps) {
const { rank, intraId, statusMessage } = user;
const messageFiltered =
statusMessage.length > 10
? statusMessage.slice(0, 10) + '...'
: statusMessage;
export default function RankListItemMain({ user }: RankListItemMainProps) {
const { rank, intraId, userImageUri } = user;
const rankFiltered = rank < 0 ? '-' : rank;
const toggleMode = useContext(ToggleModeContext);

return (
<div
className={`${styles.mainData}
${isSeasonNormal && styles.normal}`}
className={`${styles.mainData} ${
toggleMode === 'NORMAL' && styles.normal
}`}
>
<div className={styles.rankNumber}>{rankFiltered}</div>
<div className={styles.intraId}>
<Link href={`users/detail?intraId=${intraId}`}>
<span>{intraId}</span>
</Link>
<div
className={`${rank === 1 ? styles.leaf : ''} ${
toggleMode === 'NORMAL' && styles.normal
}`}
>
<div
className={`${rank === 1 ? styles.leaf1 : ''} ${
toggleMode === 'NORMAL' && styles.normal
}`}
>
<div className={`${styles.intraId} ${rank === 1 && styles.first}`}>
<Link href={`users/detail?intraId=${intraId}`}>
<PlayerImage
src={userImageUri}
styleName={rank === 1 ? 'ranktropybig' : 'ranktropy'}
size={50}
/>
<span>{intraId}</span>
Copy link
Contributor

Choose a reason for hiding this comment

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

ํ”ผ๊ทธ๋งˆ ๋ณด์‹œ๋ฉด intraId๋„ ์ˆœ์œ„์— ๋”ฐ๋ผ ํฐํŠธ์ƒ‰๊น”์ด ๋‹ฌ๋ผ์ง€๋Š” ๊ฒƒ ๊ฐ™์•„์š”!!

Copy link
Contributor Author

Choose a reason for hiding this comment

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

์™€ ๊ฒ€์€์ƒ‰์ธ์ค„ ์•Œ์•˜๋Š”๋ฐ ๋“ฑ์ˆ˜์— ๋”ฐ๋ผ ์ƒ‰์ƒ์ด ๋‹ค ๋‹ค๋ฅด๋„ค์š” ๊ฐ์‚ฌํ•ฉ๋‹ˆ๋‹ค!

</Link>
</div>
<div
className={`${
rank === 1
? styles.rankNumber1
: rank === 2
? styles.rankNumber2
: styles.rankNumber3
} ${toggleMode === 'NORMAL' && styles.normal}`}
Copy link
Member

Choose a reason for hiding this comment

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

์ด๋ถ€๋ถ„ rank์˜ ๊ฐ’์ด 1, 2, 3 ๋ฟ์ด๋ผ๋ฉด ${styles[`rankNumber${rank}`]} ์ด๋Ÿฐ ์‹์œผ๋กœ ํ•˜๋ฉด ์ข€ ๋” ๋ณด๊ธฐ ์ข‹์„ ๊ฒƒ ๊ฐ™๊ธด ํ•œ๋ฐ, ์œ„์—์„œ ๋ง์”€๋“œ๋ ธ๋˜๊ฒƒ์ฒ˜๋Ÿผ rank๊ฐ€ string์ธ ๊ฒฝ์šฐ์— ์–ด๋–ป๊ฒŒ ๋ ์ง€ ๋ด์•ผ ํ•  ๊ฒƒ ๊ฐ™์Šต๋‹ˆ๋‹ค..!

Copy link
Contributor Author

Choose a reason for hiding this comment

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

์ข‹์€ ๋ฐฉ๋ฒ• ๊ฐ์‚ฌํ•ฉ๋‹ˆ๋‹ค!

>
{rankFiltered}
</div>
</div>
</div>
<div className={styles.statusMessage}>{messageFiltered}</div>
</div>
);
}
33 changes: 14 additions & 19 deletions components/rank/topRank/RankListMain.tsx
Original file line number Diff line number Diff line change
@@ -1,32 +1,27 @@
import { RankUser, NormalUser, Rank } from 'types/rankTypes';
import RankListItemMain from './RankListItemMain';
import styles from 'styles/rank/RankListMain.module.scss';

interface RankListMainProps {
rank?: Rank;
isMain: boolean;
}

export default function RankListMain({ rank }: RankListMainProps) {
//const isNormalSeason = seasonMode === 'normal';
const isNormalSeason = false;
const content = {
normal: { style: styles.normal, title: 'VIP' },
rank: { style: '', title: 'Champion' },
both: { style: '', title: 'Champion' },
};
export default function RankListMain({ rank, isMain }: RankListMainProps) {
const bangElements = Array.from({ length: 5 }, (_, index) => (
Copy link
Contributor

Choose a reason for hiding this comment

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

Array๋ฅผ ์ด๋ ‡๊ฒŒ๋„ ๋งŒ๋“ค ์ˆ˜ ์žˆ๊ตฐ์š”. ๋ฐฐ์›Œ๊ฐ‘๋‹ˆ๋‹ค!! ๐Ÿ‘

<div
key={index}
className={`${rank?.rankList[1].rank === 1 && !isMain && styles.bang}`}
/>
));

return (
<div className={styles.mainContainer}>
<div className={`${styles.title} ${content.rank.style}`}>
{content.rank.title}
<div>
<div className={`${styles.bangContainer}`}>{bangElements}</div>
<div className={`${styles.mainContainer} ${isMain && styles.isMain}`}>
{rank?.rankList.map((item: NormalUser | RankUser) => (
<RankListItemMain key={item.intraId} user={item} />
))}
</div>
{rank?.rankList.map((item: NormalUser | RankUser) => (
<RankListItemMain
key={item.intraId}
user={item}
isSeasonNormal={isNormalSeason}
/>
))}
</div>
);
}
Loading