-
Notifications
You must be signed in to change notification settings - Fork 4
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
[feat/CK-210] 로드맵 디테일 페이지의 UI를 개편한다. #173
Merged
Merged
Changes from 8 commits
Commits
Show all changes
9 commits
Select commit
Hold shift + click to select a range
0c630e9
feat: No Image 아이콘 추가
jw-r 13aeb99
feat: 로드맵의 ExtraInfo(Meta data) 컴포넌트 구현
jw-r 51212f5
feat: Introduction(로드맵 설명) 컴포넌트 구현
jw-r e01e873
feat: NodeContent(각 노드 정보 Slider) 컴포넌트 구현
jw-r efe0c38
feat: 로드맵 디테일 컴포넌트 UI 개편
jw-r 216823a
chore: develop-client 변경사항 반영
jw-r 552796f
feat: 모임 생성, 진행중인 모임보기 버튼 구현
jw-r 1619ac8
chore: 불필요한 css 코드 제거
jw-r 0fa6668
refactor: 타입 컨벤션 반영
jw-r 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
48 changes: 48 additions & 0 deletions
48
client/src/components/roadmapDetailPage/extraInfo/ExtraInfo.styles.ts
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,48 @@ | ||
import styled from 'styled-components'; | ||
import media from '@styles/media'; | ||
|
||
export const ExtraInfo = styled.div` | ||
${({ theme }) => theme.fonts.description5}; | ||
display: flex; | ||
flex-direction: column; | ||
align-items: flex-end; | ||
justify-content: space-between; | ||
|
||
width: 30%; | ||
height: 55rem; | ||
|
||
${media.mobile` | ||
display: none; | ||
`} | ||
`; | ||
|
||
export const RoadmapMetadata = styled.div` | ||
display: flex; | ||
flex-direction: column; | ||
|
||
& > div:not(:last-child) { | ||
margin-bottom: 3rem; | ||
} | ||
`; | ||
|
||
export const Category = styled.div` | ||
display: flex; | ||
align-items: center; | ||
justify-content: flex-end; | ||
`; | ||
|
||
export const Difficulty = styled.div` | ||
text-align: end; | ||
`; | ||
|
||
export const RecommendedRoadmapPeriod = styled.div` | ||
text-align: end; | ||
`; | ||
|
||
export const Tags = styled.div` | ||
color: ${({ theme }) => theme.colors.main_dark}; | ||
|
||
& > div { | ||
text-align: end; | ||
} | ||
`; |
33 changes: 33 additions & 0 deletions
33
client/src/components/roadmapDetailPage/extraInfo/ExtraInfo.tsx
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,33 @@ | ||
import { RoadmapDetailType } from '@myTypes/roadmap/internal'; | ||
import * as S from './ExtraInfo.styles'; | ||
import SVGIcon from '@components/icons/SVGIcon'; | ||
import { CategoriesInfo } from '@constants/roadmap/category'; | ||
|
||
type ExtraInfoProps = { | ||
roadmapInfo: RoadmapDetailType; | ||
}; | ||
|
||
const ExtraInfo = ({ roadmapInfo }: ExtraInfoProps) => { | ||
return ( | ||
<S.ExtraInfo> | ||
<div>Created by {roadmapInfo.creator.name}</div> | ||
<S.RoadmapMetadata> | ||
<S.Category> | ||
카테고리: {roadmapInfo.category.name} | ||
<SVGIcon name={CategoriesInfo[roadmapInfo.category.id].iconName} /> | ||
</S.Category> | ||
<S.Difficulty>난이도: {roadmapInfo.difficulty}</S.Difficulty> | ||
<S.RecommendedRoadmapPeriod> | ||
예상 소요시간: {roadmapInfo.recommendedRoadmapPeriod}일 | ||
</S.RecommendedRoadmapPeriod> | ||
</S.RoadmapMetadata> | ||
<S.Tags> | ||
{roadmapInfo.tags.map((tag) => ( | ||
<div key={tag.id}>#{tag.name}</div> | ||
))} | ||
</S.Tags> | ||
</S.ExtraInfo> | ||
); | ||
}; | ||
|
||
export default ExtraInfo; |
47 changes: 47 additions & 0 deletions
47
client/src/components/roadmapDetailPage/introduction/Introduction.styles.ts
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,47 @@ | ||
import media from '@styles/media'; | ||
import styled from 'styled-components'; | ||
|
||
export const IntroductionWrapper = styled.div` | ||
width: 70%; | ||
|
||
${media.mobile` | ||
width:100%; | ||
`} | ||
`; | ||
|
||
export const Introduction = styled.div<{ isExpanded: boolean }>` | ||
${({ theme }) => theme.fonts.description5}; | ||
overflow: hidden; | ||
max-height: ${({ isExpanded }) => (isExpanded ? 'auto' : '55rem')}; | ||
|
||
& > p:not(:last-child) { | ||
margin-bottom: 2rem; | ||
} | ||
|
||
& div { | ||
${({ theme }) => theme.fonts.h1}; | ||
margin-bottom: 0.5rem; | ||
color: ${({ theme }) => theme.colors.main_dark}; | ||
} | ||
`; | ||
|
||
export const LineShadow = styled.div` | ||
position: relative; | ||
width: 100%; | ||
height: 0.2rem; | ||
box-shadow: 0 -4px 6px rgba(0, 0, 0, 1); | ||
`; | ||
|
||
export const ReadMoreButton = styled.button` | ||
position: relative; | ||
top: calc(-2rem - 4px); | ||
left: 50%; | ||
transform: translateX(-5rem); | ||
|
||
width: 10rem; | ||
height: 4rem; | ||
|
||
background-color: ${({ theme }) => theme.colors.white}; | ||
border-radius: 8px; | ||
box-shadow: ${({ theme }) => theme.shadows.main}; | ||
`; |
51 changes: 51 additions & 0 deletions
51
client/src/components/roadmapDetailPage/introduction/Introduction.tsx
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 { RoadmapDetailType } from '@myTypes/roadmap/internal'; | ||
import * as S from './Introduction.styles'; | ||
import { useEffect, useRef, useState } from 'react'; | ||
|
||
type IntroductionType = { | ||
roadmapInfo: RoadmapDetailType; | ||
}; | ||
|
||
const Introduction = ({ roadmapInfo }: IntroductionType) => { | ||
const [isExpanded, setIsExpanded] = useState(false); | ||
const [showMoreButton, setShowMoreButton] = useState(false); | ||
const introRef = useRef<HTMLDivElement>(null); | ||
|
||
useEffect(() => { | ||
if (!introRef.current) return; | ||
|
||
const element = introRef.current; | ||
if (element.scrollHeight > element.clientHeight) { | ||
setShowMoreButton(true); | ||
} | ||
}, []); | ||
|
||
const toggleExpand = () => { | ||
setIsExpanded(!isExpanded); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 사소한 부분이지만 There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 오메 매의 눈 굿굿! |
||
}; | ||
|
||
return ( | ||
<S.IntroductionWrapper> | ||
<S.Introduction isExpanded={isExpanded} ref={introRef}> | ||
<p> | ||
<div>설명</div> | ||
{roadmapInfo.introduction} | ||
</p> | ||
<p> | ||
<div>본문</div> | ||
{roadmapInfo.content.content === '' | ||
? '로드맵에 대한 설명이 없어요🥲' | ||
: roadmapInfo.content.content} | ||
</p> | ||
</S.Introduction> | ||
{showMoreButton && !isExpanded && ( | ||
<> | ||
<S.LineShadow /> | ||
<S.ReadMoreButton onClick={toggleExpand}>더 보기</S.ReadMoreButton> | ||
</> | ||
)} | ||
</S.IntroductionWrapper> | ||
); | ||
}; | ||
|
||
export default Introduction; |
90 changes: 90 additions & 0 deletions
90
client/src/components/roadmapDetailPage/nodeContent/NodeContent.styles.ts
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,90 @@ | ||
import styled from 'styled-components'; | ||
import media from '@styles/media'; | ||
|
||
export const SliderContent = styled.div` | ||
display: flex; | ||
aspect-ratio: 5 / 3.5; | ||
background-color: ${({ theme }) => theme.colors.gray100}; | ||
border-radius: 8px; | ||
|
||
${media.mobile` | ||
aspect-ratio: 0; | ||
`} | ||
`; | ||
|
||
export const LeftContent = styled.div` | ||
width: 45%; | ||
|
||
${media.mobile` | ||
display: none; | ||
`} | ||
`; | ||
|
||
export const NodeImg = styled.img` | ||
width: 100%; | ||
height: 100%; | ||
padding: 1.5rem; | ||
object-fit: cover; | ||
`; | ||
|
||
export const NoImg = styled.div` | ||
${({ theme }) => theme.fonts.title_large} | ||
display: flex; | ||
flex-direction: column; | ||
align-items: center; | ||
justify-content: center; | ||
|
||
width: 100%; | ||
height: 100%; | ||
`; | ||
|
||
export const Separator = styled.div` | ||
display: flex; | ||
flex-direction: column; | ||
width: 0.2rem; | ||
height: 100%; | ||
|
||
& > div { | ||
height: 50%; | ||
} | ||
|
||
& > div:last-child { | ||
background-color: black; | ||
} | ||
`; | ||
|
||
export const RightContent = styled.div` | ||
${({ theme }) => theme.fonts.h1} | ||
overflow: scroll; | ||
width: 55%; | ||
padding: 1.5rem; | ||
padding-top: 3rem; | ||
|
||
${media.mobile` | ||
width: 100%; | ||
height: 60rem; | ||
padding-top: 1.5rem; | ||
`} | ||
`; | ||
|
||
export const ContentTitle = styled.div` | ||
${({ theme }) => theme.fonts.title_large} | ||
display: flex; | ||
align-items: center; | ||
margin-bottom: 1rem; | ||
`; | ||
|
||
export const Step = styled.div` | ||
${({ theme }) => theme.fonts.h2} | ||
display: flex; | ||
flex-shrink: 0; | ||
align-items: center; | ||
justify-content: center; | ||
|
||
width: 3rem; | ||
height: 3rem; | ||
margin-right: 0.5rem; | ||
|
||
border: 0.3rem solid black; | ||
border-radius: 50%; | ||
`; |
38 changes: 38 additions & 0 deletions
38
client/src/components/roadmapDetailPage/nodeContent/NodeContent.tsx
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,38 @@ | ||
import type { NodeType } from '@myTypes/roadmap/internal'; | ||
import * as S from './NodeContent.styles'; | ||
import SVGIcon from '@components/icons/SVGIcon'; | ||
|
||
type NodeContentProps = { | ||
node: NodeType; | ||
index: number; | ||
}; | ||
|
||
const NodeContent = ({ node, index }: NodeContentProps) => { | ||
return ( | ||
<S.SliderContent key={node.id}> | ||
<S.LeftContent> | ||
{node.imageUrls[0] ? ( | ||
<S.NodeImg src={node.imageUrls[0]} /> | ||
) : ( | ||
<S.NoImg> | ||
<SVGIcon name='NoImageIcon' size={100} /> | ||
<div>No Image</div> | ||
</S.NoImg> | ||
)} | ||
</S.LeftContent> | ||
<S.Separator> | ||
<div /> | ||
<div /> | ||
</S.Separator> | ||
<S.RightContent> | ||
<S.ContentTitle> | ||
<S.Step>{index + 1}</S.Step> | ||
<p>{node.title}</p> | ||
</S.ContentTitle> | ||
{node.description} | ||
</S.RightContent> | ||
</S.SliderContent> | ||
); | ||
}; | ||
|
||
export default NodeContent; |
Oops, something went wrong.
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.
타입 네이밍 컨벤션은 InfoductionProps 에요!!
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.
반영완!