diff --git a/src/pages/rank/components/all/index.tsx b/src/pages/rank/components/all/index.tsx index 9c1ab39..0f2f280 100644 --- a/src/pages/rank/components/all/index.tsx +++ b/src/pages/rank/components/all/index.tsx @@ -25,7 +25,6 @@ const AllRank = () => { })); setUserRanks(allUserData); setLoading(false); - // console.log('rank data: ', allUserData); }; fetchUserRanking(); diff --git a/src/pages/rank/components/my/index.tsx b/src/pages/rank/components/my/index.tsx index c4ec0d0..7ecf470 100644 --- a/src/pages/rank/components/my/index.tsx +++ b/src/pages/rank/components/my/index.tsx @@ -1,49 +1,64 @@ import { TextContainer } from '../../styles'; -import * as S from './styles'; +import { useGetMyRank } from '@/apis/my-rank/my-rank.api'; import Profile from '@/assets/main/ZZAN-Profile.png'; import { getTierDetails } from '@/constants/data/tierSchema'; -import { useInfoStore } from '@/store/useInfoStore'; -import * as Base from '@/styles/baseStyles'; +import { Box, Image, Text } from '@chakra-ui/react'; +import styled from '@emotion/styled'; const MyRank = () => { - const { userInfo } = useInfoStore(); + const { data } = useGetMyRank(); - const tierDetails = userInfo?.tierInfo - ? getTierDetails(userInfo?.tierInfo.tier) + const tierDetails = data?.data.tierInfo + ? getTierDetails(data?.data.tierInfo.tier) : { color: 'var(--color-class-02)' }; return ( <> - - + + 내 순위 - - - - 1위 - - - - + + + + {data?.data.rank}위 + + + + - - {userInfo?.nickname} - - - {userInfo?.tierInfo.tier} - + + {data?.data.nickname} + + + {data?.data.tierInfo.tier} + - - + + ); }; export default MyRank; + +export const MyRankLayout = styled.div` + display: flex; + flex-direction: column; + background-color: var(--color-green-06); + border-bottom: 1px solid #bdc5cd; +`; + +export const RankInfoContainer = styled.div` + display: flex; + flex-direction: row; + align-items: center; + + justify-content: space-between; + gap: 0.6rem; + padding: 1rem 0.5rem; +`; + +export const RankPosition = styled.div` + width: 3rem; + text-align: center; + white-space: nowrap; +`; diff --git a/src/pages/rank/components/user/index.tsx b/src/pages/rank/components/user/index.tsx index b8ac737..2fb83d0 100644 --- a/src/pages/rank/components/user/index.tsx +++ b/src/pages/rank/components/user/index.tsx @@ -24,7 +24,6 @@ const UserRank: React.FC = ({ user, index }) => { = ({ user, index }) => { gap='1rem' > {tierInfo} - + {currentExp}