-
Notifications
You must be signed in to change notification settings - Fork 6
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
Design: 전체 상품 리스트 화면 구현 #33
Changes from all commits
213a7b2
d6e7773
aa77051
13de28e
6a57617
10a8a91
2027a39
8478879
51ed77f
6a55103
49b145b
78eebab
6276072
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
import * as S from "./style"; | ||
import { useLocation, Link } from "react-router-dom"; | ||
|
||
const categoryList = [ | ||
{ id: "ALL", name: "전체", search: "" }, | ||
{ id: "HOTEL_RESORT", name: "호텔/리조트", search: "?category=HOTEL_RESORT" }, | ||
{ id: "MOTEL", name: "모텔", search: "?category=MOTEL" }, | ||
{ id: "PENSION", name: "펜션", search: "?category=PENSION" }, | ||
{ id: "GUESTHOUSE", name: "게스트하우스", search: "?category=GUESTHOUSE" }, | ||
{ id: "POOL_VILLA", name: "풀빌라", search: "?category=POOL_VILLA" } | ||
Comment on lines
+5
to
+10
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. 따로 만들고 id 추가해주는 거 까지 좋네요!! 하나만 건의드려 보자면, search 부분에 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. 전체일때가 디폴트 값이라 URL이 쿼리스트링 없이 |
||
]; | ||
|
||
const CategoryTab = () => { | ||
const { search } = useLocation(); | ||
|
||
return ( | ||
<S.CategoryContainer> | ||
{categoryList.map((category) => { | ||
return ( | ||
<Link to={category.search} key={category.id}> | ||
<S.CategoryList className={search === category.search ? "selected_category" : ""}> | ||
{category.name} | ||
</S.CategoryList> | ||
</Link> | ||
); | ||
})} | ||
</S.CategoryContainer> | ||
); | ||
}; | ||
|
||
export default CategoryTab; |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
import styled from "@emotion/styled"; | ||
|
||
export const CategoryContainer = styled.ul` | ||
display: flex; | ||
justify-content: space-around; | ||
width: 100%; | ||
gap: 1rem; | ||
padding: 0rem 1rem 0.75rem 1rem; | ||
border-bottom: 1px solid ${({ theme }) => theme.colors.gray[300]}; | ||
|
||
.selected_category { | ||
color: ${({ theme }) => theme.colors.gray[900]}; | ||
${({ theme }) => theme.text.button1}; | ||
} | ||
`; | ||
|
||
export const CategoryList = styled.li` | ||
color: ${({ theme }) => theme.colors.gray[600]}; | ||
${({ theme }) => theme.text.button2}; | ||
white-space: nowrap; | ||
cursor: pointer; | ||
`; |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,204 @@ | ||
import * as S from "./style"; | ||
import MapIcon from "assets/map.svg?react"; | ||
import StarIcon from "assets/icons/Star.svg?react"; | ||
|
||
const Items = () => { | ||
return ( | ||
<S.Container> | ||
<S.ItemContainer> | ||
<S.ImageContainer> | ||
<S.Image src="https://bit.ly/2Z4KKcF" /> | ||
<S.DiscountRate>70%</S.DiscountRate> | ||
<S.LocationContainer> | ||
<MapIcon /> | ||
<S.Location>강원도 강릉시</S.Location> | ||
</S.LocationContainer> | ||
</S.ImageContainer> | ||
<S.InformationContainer> | ||
<S.ProductName>속초 굿모닝 호텔 앤 리조트</S.ProductName> | ||
<S.RoomName>Forest Tower Deluxe King</S.RoomName> | ||
<S.Period>12/25 ~ 12/26 (1박)</S.Period> | ||
<S.StarUserContainer> | ||
<S.StarContainer> | ||
<StarIcon /> | ||
<S.StarRating>4.4</S.StarRating> | ||
</S.StarContainer> | ||
<S.UserContainer> | ||
<S.UserIcon /> | ||
<S.UserNumber>기준 2명 / 최대 4명</S.UserNumber> | ||
</S.UserContainer> | ||
</S.StarUserContainer> | ||
<S.RightInnerContainer> | ||
<S.TimerNegoContainer> | ||
<S.TimerContainer> | ||
<S.TimerIcon /> | ||
<S.TimerText>3일 15시간 23분</S.TimerText> | ||
</S.TimerContainer> | ||
<S.NegoContainer> | ||
<S.NegoText>가격제안가능</S.NegoText> | ||
</S.NegoContainer> | ||
</S.TimerNegoContainer> | ||
<S.PriceContainer> | ||
<S.PriceText>원가</S.PriceText> | ||
<S.Price>2,000,000원</S.Price> | ||
</S.PriceContainer> | ||
<S.PriceContainer> | ||
<S.PriceText>구매가</S.PriceText> | ||
<S.Price>2,000,000원</S.Price> | ||
</S.PriceContainer> | ||
<S.PriceContainer> | ||
<S.PriceText>판매가</S.PriceText> | ||
<S.Price className="sellingPrice">1,264,000원</S.Price> | ||
</S.PriceContainer> | ||
</S.RightInnerContainer> | ||
</S.InformationContainer> | ||
</S.ItemContainer> | ||
<S.ItemContainer> | ||
<S.ImageContainer> | ||
<S.Image src="https://bit.ly/2Z4KKcF" /> | ||
<S.DiscountRate>70%</S.DiscountRate> | ||
<S.LocationContainer> | ||
<MapIcon /> | ||
<S.Location>강원도 강릉시</S.Location> | ||
</S.LocationContainer> | ||
</S.ImageContainer> | ||
<S.InformationContainer> | ||
<S.ProductName>속초 굿모닝 호텔 앤 리조트</S.ProductName> | ||
<S.RoomName>Forest Tower Deluxe King</S.RoomName> | ||
<S.Period>12/25 ~ 12/26 (1박)</S.Period> | ||
<S.StarUserContainer> | ||
<S.StarContainer> | ||
<StarIcon /> | ||
<S.StarRating>4.4</S.StarRating> | ||
</S.StarContainer> | ||
<S.UserContainer> | ||
<S.UserIcon /> | ||
<S.UserNumber>기준 2명 / 최대 4명</S.UserNumber> | ||
</S.UserContainer> | ||
</S.StarUserContainer> | ||
<S.RightInnerContainer> | ||
<S.TimerNegoContainer> | ||
<S.TimerContainer> | ||
<S.TimerIcon /> | ||
<S.TimerText>3일 15시간 23분</S.TimerText> | ||
</S.TimerContainer> | ||
<S.NegoContainer> | ||
<S.NegoText>가격제안가능</S.NegoText> | ||
</S.NegoContainer> | ||
</S.TimerNegoContainer> | ||
<S.PriceContainer> | ||
<S.PriceText>원가</S.PriceText> | ||
<S.Price>2,000,000원</S.Price> | ||
</S.PriceContainer> | ||
<S.PriceContainer> | ||
<S.PriceText>구매가</S.PriceText> | ||
<S.Price>2,000,000원</S.Price> | ||
</S.PriceContainer> | ||
<S.PriceContainer> | ||
<S.PriceText>판매가</S.PriceText> | ||
<S.Price className="sellingPrice">1,264,000원</S.Price> | ||
</S.PriceContainer> | ||
</S.RightInnerContainer> | ||
</S.InformationContainer> | ||
</S.ItemContainer> | ||
<S.ItemContainer> | ||
<S.ImageContainer> | ||
<S.Image src="https://bit.ly/2Z4KKcF" /> | ||
<S.DiscountRate>70%</S.DiscountRate> | ||
<S.LocationContainer> | ||
<MapIcon /> | ||
<S.Location>강원도 강릉시</S.Location> | ||
</S.LocationContainer> | ||
</S.ImageContainer> | ||
<S.InformationContainer> | ||
<S.ProductName>속초 굿모닝 호텔 앤 리조트</S.ProductName> | ||
<S.RoomName>Forest Tower Deluxe King</S.RoomName> | ||
<S.Period>12/25 ~ 12/26 (1박)</S.Period> | ||
<S.StarUserContainer> | ||
<S.StarContainer> | ||
<StarIcon /> | ||
<S.StarRating>4.4</S.StarRating> | ||
</S.StarContainer> | ||
<S.UserContainer> | ||
<S.UserIcon /> | ||
<S.UserNumber>기준 2명 / 최대 4명</S.UserNumber> | ||
</S.UserContainer> | ||
</S.StarUserContainer> | ||
<S.RightInnerContainer> | ||
<S.TimerNegoContainer> | ||
<S.TimerContainer> | ||
<S.TimerIcon /> | ||
<S.TimerText>3일 15시간 23분</S.TimerText> | ||
</S.TimerContainer> | ||
<S.NegoContainer> | ||
<S.NegoText>가격제안가능</S.NegoText> | ||
</S.NegoContainer> | ||
</S.TimerNegoContainer> | ||
<S.PriceContainer> | ||
<S.PriceText>원가</S.PriceText> | ||
<S.Price>2,000,000원</S.Price> | ||
</S.PriceContainer> | ||
<S.PriceContainer> | ||
<S.PriceText>구매가</S.PriceText> | ||
<S.Price>2,000,000원</S.Price> | ||
</S.PriceContainer> | ||
<S.PriceContainer> | ||
<S.PriceText>판매가</S.PriceText> | ||
<S.Price className="sellingPrice">1,264,000원</S.Price> | ||
</S.PriceContainer> | ||
</S.RightInnerContainer> | ||
</S.InformationContainer> | ||
</S.ItemContainer> | ||
<S.ItemContainer> | ||
<S.ImageContainer> | ||
<S.Image src="https://bit.ly/2Z4KKcF" /> | ||
<S.DiscountRate>70%</S.DiscountRate> | ||
<S.LocationContainer> | ||
<MapIcon /> | ||
<S.Location>강원도 강릉시</S.Location> | ||
</S.LocationContainer> | ||
</S.ImageContainer> | ||
<S.InformationContainer> | ||
<S.ProductName>속초 굿모닝 호텔 앤 리조트</S.ProductName> | ||
<S.RoomName>Forest Tower Deluxe King</S.RoomName> | ||
<S.Period>12/25 ~ 12/26 (1박)</S.Period> | ||
<S.StarUserContainer> | ||
<S.StarContainer> | ||
<StarIcon /> | ||
<S.StarRating>4.4</S.StarRating> | ||
</S.StarContainer> | ||
<S.UserContainer> | ||
<S.UserIcon /> | ||
<S.UserNumber>기준 2명 / 최대 4명</S.UserNumber> | ||
</S.UserContainer> | ||
</S.StarUserContainer> | ||
<S.RightInnerContainer> | ||
<S.TimerNegoContainer> | ||
<S.TimerContainer> | ||
<S.TimerIcon /> | ||
<S.TimerText>3일 15시간 23분</S.TimerText> | ||
</S.TimerContainer> | ||
<S.NegoContainer> | ||
<S.NegoText>가격제안가능</S.NegoText> | ||
</S.NegoContainer> | ||
</S.TimerNegoContainer> | ||
<S.PriceContainer> | ||
<S.PriceText>원가</S.PriceText> | ||
<S.Price>2,000,000원</S.Price> | ||
</S.PriceContainer> | ||
<S.PriceContainer> | ||
<S.PriceText>구매가</S.PriceText> | ||
<S.Price>2,000,000원</S.Price> | ||
</S.PriceContainer> | ||
<S.PriceContainer> | ||
<S.PriceText>판매가</S.PriceText> | ||
<S.Price className="sellingPrice">1,264,000원</S.Price> | ||
</S.PriceContainer> | ||
</S.RightInnerContainer> | ||
</S.InformationContainer> | ||
</S.ItemContainer> | ||
</S.Container> | ||
); | ||
}; | ||
|
||
export default Items; |
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.
지금 pr은 안올라가 있는데 이 부분 prop으로 받을 수 있게 수정해두긴했었습니다..! 지금 보니까 transparent보다 #fff들어가있는 경우가 많은것 같아 #fff가 기본이고 transparent를 prop으로 받을 수 있게 하는 방향으로 수정해두겠습니당
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.
넵 감사합니당! !