-
Notifications
You must be signed in to change notification settings - Fork 0
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
프로필 페이지 #82
Merged
Merged
프로필 페이지 #82
Changes from 2 commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
import { styled } from 'styled-components'; | ||
export const BadgeWrapper = styled.div` | ||
display: flex; | ||
margin-top: 39px; | ||
width: 100%; | ||
gap: 12px; | ||
justify-content: space-between; | ||
padding: 0 17px; | ||
> ul { | ||
display: flex; | ||
flex-wrap: wrap; | ||
gap: 25px; | ||
} | ||
`; | ||
export const PaginationIcon = styled.img<{ $rotate?: string }>` | ||
width: 9px; | ||
height: 20px; | ||
transform: rotate(${({ $rotate }) => $rotate || 0}); | ||
`; | ||
export const PaginationButton = styled.button` | ||
border: 0; | ||
background-color: transparent; | ||
`; | ||
export const BadgeListItem = styled.li` | ||
display: flex; | ||
flex-direction: column; | ||
gap: 11px; | ||
> div { | ||
display: flex; | ||
justify-content: center; | ||
align-items: center; | ||
width: 133px; | ||
height: 141px; | ||
flex-shrink: 0; | ||
border-radius: 8px; | ||
border: 2px solid #ffe161; | ||
background: #ffefaa; | ||
} | ||
> h5 { | ||
border-radius: 8px; | ||
border: 2px solid #ffefaa; | ||
background: #ffe161; | ||
color: #fff; | ||
text-align: center; | ||
font-size: 12px; | ||
font-style: normal; | ||
font-weight: 700; | ||
line-height: 24px; /* 266.667% */ | ||
text-transform: lowercase; | ||
} | ||
`; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,57 @@ | ||
import { | ||
BadgeListItem, | ||
BadgeWrapper, | ||
PaginationButton, | ||
PaginationIcon, | ||
} from '../styles'; | ||
import { getImageUrl } from '@/utils/getImageUrl'; | ||
|
||
const testBadgeList = [ | ||
{ | ||
id: 1, | ||
badgeImage: '테스트뱃지.webp', | ||
badgeTitle: '왕', | ||
}, | ||
{ | ||
id: 2, | ||
badgeImage: '테스트뱃지.webp', | ||
badgeTitle: '왕왕', | ||
}, | ||
{ | ||
id: 3, | ||
badgeImage: '테스트뱃지.webp', | ||
badgeTitle: '왕대대', | ||
}, | ||
{ | ||
id: 4, | ||
badgeImage: '테스트뱃지.webp', | ||
badgeTitle: '왕대대왕', | ||
}, | ||
]; | ||
export default function BadgeContainer() { | ||
return ( | ||
<> | ||
<BadgeWrapper> | ||
<PaginationButton> | ||
<PaginationIcon src={getImageUrl('뱃지-다음버튼.svg')} /> | ||
</PaginationButton> | ||
<ul> | ||
{testBadgeList.map(badgeItem => ( | ||
<BadgeListItem key={badgeItem.id}> | ||
<div> | ||
<img src={getImageUrl(badgeItem.badgeImage)} /> | ||
</div> | ||
<h5>{badgeItem.badgeTitle}</h5> | ||
</BadgeListItem> | ||
))} | ||
</ul> | ||
<PaginationButton> | ||
<PaginationIcon | ||
src={getImageUrl('뱃지-다음버튼.svg')} | ||
$rotate="180deg" | ||
/> | ||
</PaginationButton> | ||
</BadgeWrapper> | ||
</> | ||
); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
import { getImageUrl } from '@/utils/getImageUrl'; | ||
|
||
export default function ProfileImage() { | ||
//기능 제작 시 자기 캐릭터에서 프로필이미지 추출하는 로직 추가 | ||
return ( | ||
<> | ||
<img src={getImageUrl('테스트프로필.svg')} /> | ||
</> | ||
); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,112 @@ | ||
import CokoLogo from '@common/layout/CokoLogo'; | ||
import MenuBar from '@common/layout/MenuBar'; | ||
import { Layout, LeftSection, RightSection, Wrapper } from '@/style/style'; | ||
import Header from '@common/layout/Header'; | ||
import { | ||
BadgeLabel, | ||
JoinDateLabel, | ||
LevelDiv, | ||
MyProgressDiv, | ||
MyQuizInfoDiv, | ||
UserNameLabel, | ||
ProfileSection, | ||
BadgeSection, | ||
LevelList, | ||
LevelLabel, | ||
MyCharacterImage, | ||
} from './styles'; | ||
import ProfileImage from '@features/user/ui/ProfileImage'; | ||
import ProgressBar from '@features/progress/ui/ProgressBar'; | ||
import { getImageUrl } from '@/utils/getImageUrl'; | ||
import BadgeContainer from '@features/user/ui/BadgeContainer'; | ||
import React from 'react'; | ||
const levelList = [60, 50, 40, 30, 20, 10]; | ||
export default function Profile() { | ||
return ( | ||
<> | ||
<Wrapper> | ||
<LeftSection> | ||
<CokoLogo /> | ||
<MenuBar /> | ||
</LeftSection> | ||
<RightSection> | ||
<Header /> | ||
|
||
<LevelDiv> | ||
<div> | ||
<MyCharacterImage src={getImageUrl('테스트캐릭터.svg')} /> | ||
<LevelLabel>Level.1</LevelLabel> | ||
</div> | ||
<LevelList> | ||
{levelList.map(level => ( | ||
<React.Fragment key={level}> | ||
<li> | ||
<span>Level.{level} </span> - | ||
</li> | ||
<li>—</li> | ||
</React.Fragment> | ||
))} | ||
</LevelList> | ||
<ProgressBar | ||
$progress={40} | ||
$maxProgress={100} | ||
$height="20px" | ||
$innerBgColor="#FFD100;" | ||
$boxBgColor="#FFEFAA" | ||
style={{ | ||
width: '600px', | ||
position: 'absolute', | ||
transform: 'rotate(-90deg)', | ||
right: '-270px', | ||
top: '300px', | ||
}} | ||
/> | ||
</LevelDiv> | ||
</RightSection> | ||
</Wrapper> | ||
<Layout> | ||
<ProfileSection> | ||
<div> | ||
<ProfileImage /> | ||
<UserNameLabel>유저 이름</UserNameLabel> | ||
<JoinDateLabel>2024.10.01</JoinDateLabel> | ||
</div> | ||
<MyProgressDiv> | ||
<p> | ||
코코에 접속한 지 벌써 <span>20</span>일이 됐어요 ! | ||
</p> | ||
<img src={getImageUrl('출석일수.svg')}></img> | ||
<div> | ||
<p>진행도</p> | ||
<ProgressBar | ||
$progress={40} | ||
$maxProgress={100} | ||
$height="20px" | ||
$innerBgColor="#BFD683" | ||
$boxBgColor="#85705F" | ||
style={{ | ||
width: '283px', | ||
}} | ||
/> | ||
</div> | ||
<MyQuizInfoDiv> | ||
<p> | ||
푼 문제 <span>52</span>개 | ||
</p> | ||
<p> | ||
틀린 문제 <span>52</span>개 | ||
</p> | ||
<p> | ||
안 푼 문제 <span>52</span>개 | ||
</p> | ||
</MyQuizInfoDiv> | ||
</MyProgressDiv> | ||
</ProfileSection> | ||
<BadgeSection> | ||
<BadgeLabel>나의 뱃지</BadgeLabel> | ||
<BadgeContainer /> | ||
</BadgeSection> | ||
</Layout> | ||
</> | ||
); | ||
} |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
. . .
위와 같이 사용해 보는건 어떨까요?🧐
S-dot
이라고 불리는 방식인데, 이런식으로 적으면 아래와 같은 이점이 있습니다.styled-componet
라는것도 명확해짐S.
으로 접근이 가능하기 때문에 편리함생각해보시고, 적용해보시는 것을 추천드립니다!👏
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
미니 프로젝트에서 적용했던 방법인데 프로젝트를 하다보니 이런 세세한 부분을 놓쳐버렸네요 😢
다시 복기시켜주셔서 감사합니다.
@zzzRYT 님 의견대로
import
구문쪽에 간소화되는게 좋은 것 같습니다!꼼꼼하게 봐주셔서 감사합니다 😊
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
26d1e68 커밋에서 해당 방식을 적용시켰습니다. 확실히
import
구문이 간소화되네요 ㅎㅎThere was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@zzzRYT 님께서 말씀하신 것처럼 해당 컴포넌트가
styled-componet
라는 점, import 부분 간소화 등 장점이 확실한 방법입니다.아쉬운 점이라면 스타일드 컴포넌트 파일 안에 내가 필요로 하지 않는 스타일까지 있다면
S-dot
방식을 사용할 떄 그런 필요로 하지 않는 스타일까지 import 시키기 때문에 스타일드 컴포넌트 파일 자체가 조금 무거운 편이라면 약간의 시간차가 발생할 수 있다네용😊