-
Notifications
You must be signed in to change notification settings - Fork 2
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
[FE] feat: 리뷰 목록 페이지 기능 구현 #90
Changes from all commits
9c72fb9
e3e33a6
ee8b83d
0a2ab6a
6a51f29
8750b3f
79d1054
2ccd546
aeeace5
e71caf1
f67438e
d71ed5f
aac2762
163726e
af2de05
26fb5d7
042e646
a0aba88
daee123
368870a
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,53 @@ | ||
import GithubLogo from '@/assets/githubLogo.svg'; | ||
import Lock from '@/assets/lock.svg'; | ||
import UnLock from '@/assets/unLock.svg'; | ||
|
||
import * as S from './styles'; | ||
|
||
interface ReviewPreviewCardProps { | ||
reviewerGroup: { | ||
name: string; | ||
}; | ||
createdAt: string; | ||
contentPreview: string; | ||
keywords: { id: number; content: string }[]; | ||
isPublic: boolean; | ||
} | ||
|
||
const ReviewPreviewCard = ({ | ||
reviewerGroup, | ||
createdAt, | ||
contentPreview, | ||
keywords, | ||
isPublic, | ||
}: ReviewPreviewCardProps) => { | ||
return ( | ||
<S.Layout> | ||
<S.Header> | ||
<S.HeaderContainer> | ||
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. HeaderContainer가 Header보다 상위에 있는 네이밍이라고 생각해요. 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. 생각해보니
<Layout>
<Header>
<HeaderContent />
</Header>
<Main />
</Layout> |
||
<div> | ||
<img src={GithubLogo} /> | ||
</div> | ||
<div> | ||
<S.Title>{reviewerGroup.name}</S.Title> | ||
<S.SubTitle>{createdAt}</S.SubTitle> | ||
</div> | ||
</S.HeaderContainer> | ||
<S.Visibility> | ||
<img src={isPublic ? UnLock : Lock} /> | ||
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. img에 alt가 없네요 |
||
<span>{isPublic ? '공개' : '비공개'}</span> | ||
</S.Visibility> | ||
</S.Header> | ||
<S.Main> | ||
<span>{contentPreview}</span> | ||
<S.Keyword> | ||
{keywords.map((keyword) => ( | ||
<div key={keyword.id}>{keyword.content}</div> | ||
))} | ||
</S.Keyword> | ||
</S.Main> | ||
</S.Layout> | ||
); | ||
}; | ||
|
||
export default ReviewPreviewCard; |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,85 @@ | ||
import styled from '@emotion/styled'; | ||
|
||
export const Layout = styled.div` | ||
display: flex; | ||
flex-direction: column; | ||
|
||
width: 100%; | ||
|
||
border: 1px solid ${({ theme }) => theme.colors.lightGray}; | ||
border-radius: 8px; | ||
|
||
&:hover { | ||
cursor: pointer; | ||
border: 1px solid ${({ theme }) => theme.colors.primaryHover}; | ||
|
||
& > div:first-of-type { | ||
background-color: ${({ theme }) => theme.colors.primaryHover}; | ||
} | ||
} | ||
`; | ||
|
||
export const Header = styled.div` | ||
display: flex; | ||
justify-content: space-between; | ||
|
||
height: 6rem; | ||
padding: 1rem 3rem; | ||
|
||
background-color: ${({ theme }) => theme.colors.lightGray}; | ||
border-top-left-radius: 0.8rem; | ||
border-top-right-radius: 0.8rem; | ||
Comment on lines
+30
to
+31
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.
|
||
`; | ||
|
||
export const HeaderContainer = styled.div` | ||
display: flex; | ||
gap: 1rem; | ||
|
||
img { | ||
width: 4rem; | ||
} | ||
`; | ||
|
||
export const Title = styled.div` | ||
font-size: 1.6rem; | ||
font-weight: 700; | ||
`; | ||
|
||
export const SubTitle = styled.div` | ||
font-size: 1.2rem; | ||
`; | ||
|
||
export const Visibility = styled.div` | ||
display: flex; | ||
gap: 0.6rem; | ||
align-items: center; | ||
font-size: 1.6rem; | ||
font-weight: 700; | ||
|
||
img { | ||
width: 2rem; | ||
} | ||
`; | ||
|
||
export const Main = styled.div` | ||
display: flex; | ||
flex-direction: column; | ||
gap: 2rem; | ||
|
||
padding: 2rem 3rem; | ||
|
||
font-size: 1.6rem; | ||
`; | ||
|
||
export const Keyword = styled.div` | ||
display: flex; | ||
gap: 3rem; | ||
align-items: center; | ||
font-size: 1.4rem; | ||
|
||
div { | ||
padding: 0.5rem 3rem; | ||
background-color: ${({ theme }) => theme.colors.primaryHover}; | ||
border-radius: 0.8rem; | ||
} | ||
`; |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
import * as S from './styles'; | ||
|
||
interface DropDownProps { | ||
onChange: (value: string) => void; | ||
options: string[]; | ||
} | ||
|
||
const DropDown = ({ onChange, options }: DropDownProps) => { | ||
const handleChange = (e: React.ChangeEvent<HTMLSelectElement>) => { | ||
onChange(e.target.value); | ||
}; | ||
|
||
return ( | ||
<S.Container onChange={handleChange}> | ||
{options.map((option) => ( | ||
<option key={option} value={option}> | ||
{option} | ||
</option> | ||
))} | ||
</S.Container> | ||
); | ||
}; | ||
|
||
export default DropDown; |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
import styled from '@emotion/styled'; | ||
|
||
export const Container = styled.select` | ||
width: 12rem; | ||
padding: 8px; | ||
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. 잡았다'px' 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. 아이고😅 |
||
|
||
font-size: 1.6rem; | ||
|
||
border: 1px solid ${({ theme }) => theme.colors.placeholder}; | ||
border-radius: 0.8rem; | ||
`; |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -10,5 +10,10 @@ export const Input = styled.input<InputProps>` | |
padding: 1.6rem; | ||
|
||
border: 1px solid ${({ theme }) => theme.colors.black}; | ||
border-radius: 1.5rem; | ||
border-radius: 0.8rem; | ||
|
||
&::placeholder { | ||
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. placeholder를 따로 스타일링할 수 있군요! |
||
font-size: 1.2rem; | ||
color: ${({ theme }) => theme.colors.placeholder}; | ||
} | ||
`; |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,7 @@ | ||
export const PAGE = { | ||
myPage: '마이페이지', | ||
reviewWriting: '리뷰 작성하기', | ||
allReview: '전체 리뷰 보기', | ||
reviewPreviewList: '전체 리뷰 보기', | ||
detailedReview: '상세 리뷰 보기', | ||
reviewGroupManagement: '리뷰 그룹 관리', | ||
}; |
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.
키워드 관련 타입이나 인터페이스는 따로 없나요? 리터럴을 의도했다면 그 이유가 궁금해요!
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.
키워드 인터페이스가 정의되어 있네요~~
아래와 같이 수정했어요~~