Skip to content

Commit

Permalink
Merge pull request #40 from BbeumbungE/feat/FRONT-315
Browse files Browse the repository at this point in the history
fix: 랭킹 페이지 스크롤 제거 및 캐릭터 위치 설정 수정 [FRONT-315]
  • Loading branch information
YeryunJung authored Oct 6, 2023
2 parents f2eb25b + e9d2264 commit f381203
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 13 deletions.
5 changes: 5 additions & 0 deletions client/src/pages/RankingPage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,11 @@ const RankingPageContainer = styled.div`
padding: 2.5rem;
align-items: center;
justify-content: center;
width: 100vw;
height: 100vh;
min-height: 100vh;
position: fixed;
overflow: hidden;
`;

const PostContainer = styled.div`
Expand Down
28 changes: 15 additions & 13 deletions client/src/pages/StageMapPage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -235,22 +235,24 @@ function StageMapPage() {
}

useEffect(() => {
let positionIndex = 1;
if (userLevel.highestClearedStageNumber) {
let positionIndex = getPositionIndex(userLevel.highestClearedStageNumber);

// 만약 highestClearedStageNumber가 4 이상이면 positionIndex를 3으로 설정
if (userLevel.highestClearedStageNumber >= 4) {
console.log('유저의 최고레벨', userLevel.highestClearedStageNumber);
positionIndex = 3;
if (userLevel.highestClearedStageNumber >= userLevel.level[0].stageNum) {
positionIndex = getPositionIndex(userLevel.highestClearedStageNumber);

// 만약 highestClearedStageNumber가 4 이상이면 positionIndex를 3으로 설정
if (userLevel.highestClearedStageNumber >= 4) {
console.log('유저의 최고레벨', userLevel.highestClearedStageNumber);
positionIndex = 3;
}
console.log('유저 포지션 인덱스', positionIndex);
}
console.log('유저 포지션 인덱스', positionIndex);

// 최고 기록 레벨을 초기 선택된 레벨로 설정
setSelectedLevelIndex(positionIndex - 1);
// 최고 기록 레벨을 초기 캐릭터 위치로 설정
const newPosition = levelPositions[positionIndex];
setCharacterPosition(newPosition);
}
// 최고 기록 레벨을 초기 선택된 레벨로 설정
setSelectedLevelIndex(positionIndex - 1);
// 최고 기록 레벨을 초기 캐릭터 위치로 설정
const newPosition = levelPositions[positionIndex];
setCharacterPosition(newPosition);
}, [userLevel, currentPage]);

console.log('초기 캐릭터 위치는?', characterPosition);
Expand Down

0 comments on commit f381203

Please sign in to comment.