-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #73 from LikeLion-Hackathon-T1/develop
api 수정 반영 배포
- Loading branch information
Showing
21 changed files
with
415 additions
and
189 deletions.
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
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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
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
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
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
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,68 @@ | ||
import styled from "styled-components"; | ||
|
||
const MenuItem = ({ item }) => { | ||
const handlePrice = (price) => { | ||
return price.toString().replace(/\B(?=(\d{3})+(?!\d))/g, ","); | ||
}; | ||
|
||
return ( | ||
<Container> | ||
<img src="https://via.placeholder.com/150" alt="menu" /> | ||
<div className="menu"> | ||
<div className="menu-header"> | ||
<span className="title-text">{item.menuName}</span> | ||
<span className="sub-text"> {item.quantity}개</span> | ||
</div> | ||
<span className="price"> | ||
가격: {handlePrice(item.totalPrice)}원 | ||
</span> | ||
</div> | ||
</Container> | ||
); | ||
}; | ||
|
||
export default MenuItem; | ||
|
||
const Container = styled.div` | ||
padding: 24px 20px; | ||
display: flex; | ||
gap: 12px; | ||
position: relative; | ||
border-top: 1px solid ${({ theme }) => theme.color.gray100}; | ||
img { | ||
width: 78px; | ||
height: 78px; | ||
border-radius: 12px; | ||
} | ||
.menu { | ||
margin: 2px 0; | ||
display: flex; | ||
flex-direction: column; | ||
justify-content: space-between; | ||
.menu-header { | ||
display: flex; | ||
font-weight: ${({ theme }) => theme.fontWeight.medium}; | ||
flex-direction: column; | ||
font-size: 14px; | ||
gap: 8px; | ||
.title-text { | ||
color: ${({ theme }) => theme.color.black900}; | ||
} | ||
.sub-text { | ||
color: ${({ theme }) => theme.color.gray500}; | ||
} | ||
} | ||
.price { | ||
font-weight: ${({ theme }) => theme.fontWeight.semiBold}; | ||
color: ${({ theme }) => theme.color.black900}; | ||
font-size: 16px; | ||
} | ||
} | ||
`; |
Oops, something went wrong.