-
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 #63 from LikeLion-Hackathon-T1/develop
사장님 뷰 배포
- Loading branch information
Showing
12 changed files
with
696 additions
and
3 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
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,164 @@ | ||
import styled from "styled-components"; | ||
import add from "assets/images/add-button.png"; | ||
import { useCallback, useState } from "react"; | ||
import Button from "components/Common/Button"; | ||
|
||
const AddModal = ({ onClose = () => {} }) => { | ||
const [menu, setMenu] = useState({ | ||
name: "", | ||
description: "", | ||
price: "", | ||
}); | ||
|
||
const handleChange = useCallback( | ||
(e) => { | ||
const { name, value } = e.target; | ||
setMenu({ | ||
...menu, | ||
[name]: value, | ||
}); | ||
}, | ||
[menu] | ||
); | ||
return ( | ||
<AddMenu> | ||
<div className="body"> | ||
<div className="photo"> | ||
<span>사진을 추가해주세요</span> | ||
<img src={add} alt="add" /> | ||
</div> | ||
<div className="form"> | ||
<div className="item"> | ||
<span>메뉴</span> | ||
<input | ||
type="text" | ||
name="name" | ||
value={menu.name} | ||
onChange={handleChange} | ||
placeholder="메뉴 이름을 입력해주세요" | ||
/> | ||
</div> | ||
<div className="item"> | ||
<span>설명</span> | ||
<input | ||
type="text" | ||
name="description" | ||
value={menu.description} | ||
onChange={handleChange} | ||
placeholder="이 메뉴에 대해 설명해주세요" | ||
/> | ||
</div> | ||
<div className="item"> | ||
<span>가격</span> | ||
<input | ||
type="text" | ||
name="price" | ||
value={menu.price} | ||
onChange={handleChange} | ||
placeholder="가격을 입력해주세요" | ||
/> | ||
</div> | ||
</div> | ||
<div className="buttons"> | ||
<Button text="취소" onClick={() => onClose()} /> | ||
<Button text="완료" type="2" onClick={() => onClose()} /> | ||
</div> | ||
</div> | ||
</AddMenu> | ||
); | ||
}; | ||
|
||
export default AddModal; | ||
|
||
const AddMenu = styled.div` | ||
z-index: 100; | ||
position: fixed; | ||
width: 100dvw; | ||
height: 100dvh; | ||
background-color: rgba(0, 0, 0, 0.5); | ||
top: 0; | ||
left: 0; | ||
display: flex; | ||
justify-content: center; | ||
align-items: center; | ||
.buttons { | ||
display: flex; | ||
justify-content: space-between; | ||
gap: 13px; | ||
} | ||
.body { | ||
width: 400px; | ||
background-color: white; | ||
border-radius: 10px; | ||
padding: 20px; | ||
@media (max-width: 480px) { | ||
width: calc(100% - 80px); | ||
} | ||
display: flex; | ||
flex-direction: column; | ||
gap: 24px; | ||
} | ||
.form { | ||
display: flex; | ||
flex-direction: column; | ||
gap: 20px; | ||
.item { | ||
display: flex; | ||
flex-direction: column; | ||
gap: 12px; | ||
span { | ||
font-size: 16px; | ||
font-weight: ${({ theme }) => theme.fontWeight.semiBold}; | ||
color: ${({ theme }) => theme.color.gray900}; | ||
} | ||
input { | ||
height: 46px; | ||
border: 1px solid ${({ theme }) => theme.color.gray200}; | ||
font-weight: ${({ theme }) => theme.fontWeight.mediaum}; | ||
color: ${({ theme }) => theme.color.gray900}; | ||
border-radius: 8px; | ||
padding: 0 16px; | ||
font-size: 16px; | ||
outline: none; | ||
&::placeholder { | ||
color: ${({ theme }) => theme.color.gray600}; | ||
} | ||
} | ||
} | ||
} | ||
.photo { | ||
background-color: ${({ theme }) => theme.color.gray50}; | ||
height: 142px; | ||
display: flex; | ||
flex-direction: column; | ||
justify-content: center; | ||
align-items: center; | ||
gap: 12px; | ||
border-radius: 8px; | ||
border: 1px solid ${({ theme }) => theme.color.gray200}; | ||
span { | ||
font-size: 18px; | ||
font-weight: ${({ theme }) => theme.fontWeight.semiBold}; | ||
color: ${({ theme }) => theme.color.gray900}; | ||
} | ||
img { | ||
&:hover { | ||
cursor: pointer; | ||
transform: scale(1.08); | ||
transition: transform 0.1s; | ||
} | ||
} | ||
} | ||
`; |
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,9 @@ | ||
const Menu = () => { | ||
return ( | ||
<div> | ||
<h1>Menu</h1> | ||
</div> | ||
); | ||
}; | ||
|
||
export default Menu; |
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,93 @@ | ||
import { useState } from "react"; | ||
import styled from "styled-components"; | ||
import AddModal from "owner/components/AddModal"; | ||
import Button from "components/Common/Button"; | ||
import MenuItem from "components/Store/MenuItem"; | ||
|
||
const MenuEditTab = ({ item }) => { | ||
const [isAddModalOpen, setIsAddModalOpen] = useState(false); | ||
|
||
return ( | ||
<> | ||
<ListContainer> | ||
<div className="item-wrapper"> | ||
<MenuItem item={item} /> | ||
</div> | ||
<div className="item-wrapper"> | ||
<MenuItem item={item} /> | ||
</div> | ||
<div className="item-wrapper"> | ||
<MenuItem item={item} /> | ||
</div> | ||
<div className="item-wrapper"> | ||
<MenuItem item={item} /> | ||
</div> | ||
<div className="item-wrapper"> | ||
<MenuItem item={item} /> | ||
</div> | ||
<div className="item-wrapper"> | ||
<MenuItem item={item} /> | ||
</div> | ||
<div className="item-wrapper"> | ||
<MenuItem item={item} /> | ||
</div> | ||
<div className="item-wrapper"> | ||
<MenuItem item={item} /> | ||
</div> | ||
<div className="item-wrapper"> | ||
<MenuItem item={item} /> | ||
</div> | ||
<div className="item-wrapper"> | ||
<MenuItem item={item} /> | ||
</div> | ||
<div className="item-wrapper"> | ||
<MenuItem item={item} /> | ||
</div> | ||
<div className="item-wrapper"> | ||
<MenuItem item={item} /> | ||
</div> | ||
</ListContainer> | ||
{isAddModalOpen && ( | ||
<AddModal | ||
onClose={() => { | ||
setIsAddModalOpen(false); | ||
}} | ||
/> | ||
)} | ||
<ButtonContainer> | ||
<div className="position"> | ||
<Button | ||
text="메뉴 추가" | ||
type="2" | ||
onClick={() => { | ||
setIsAddModalOpen(true); | ||
}} | ||
/> | ||
</div> | ||
</ButtonContainer> | ||
</> | ||
); | ||
}; | ||
|
||
export default MenuEditTab; | ||
|
||
const ButtonContainer = styled.div` | ||
position: fixed; | ||
width: 440px; | ||
margin: 0 20px; | ||
bottom: 20px; | ||
@media (max-width: 480px) { | ||
width: calc(100% - 40px); | ||
} | ||
`; | ||
|
||
const ListContainer = styled.div` | ||
margin-top: -53px; | ||
margin-bottom: 100px; | ||
.item-wrapper { | ||
padding: 20px 20px 0px 20px; | ||
border-top: 1px solid ${({ theme }) => theme.color.gray100}; | ||
} | ||
`; |
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,9 @@ | ||
const Order = () => { | ||
return ( | ||
<div> | ||
<h1>Order</h1> | ||
</div> | ||
); | ||
}; | ||
|
||
export default Order; |
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,55 @@ | ||
import styled from "styled-components"; | ||
|
||
const OrderItem = () => { | ||
return ( | ||
<Container> | ||
<div className="content"> | ||
<img src="https://via.placeholder.com/150" alt="주문상품" /> | ||
<div className="item-info"> | ||
<div> | ||
<span>치즈 참치 김밥</span> | ||
<span className="count">2개</span> | ||
</div> | ||
<span className="price">가격: 5,000원</span> | ||
</div> | ||
</div> | ||
</Container> | ||
); | ||
}; | ||
|
||
export default OrderItem; | ||
|
||
const Container = styled.div` | ||
border-top: 1px solid ${({ theme }) => theme.color.gray100}; | ||
font-weight: ${({ theme }) => theme.fontWeight.medium}; | ||
color: ${({ theme }) => theme.color.gray900}; | ||
padding: 24px 20px 24px 20px; | ||
font-size: 14px; | ||
img { | ||
width: 78px; | ||
height: 78px; | ||
border-radius: 12px; | ||
} | ||
.content { | ||
display: flex; | ||
gap: 12px; | ||
div { | ||
display: flex; | ||
flex-direction: column; | ||
justify-content: space-between; | ||
gap: 8px; | ||
} | ||
} | ||
.count { | ||
color: ${({ theme }) => theme.color.gray500}; | ||
} | ||
.price { | ||
font-weight: ${({ theme }) => theme.fontWeight.semiBold}; | ||
} | ||
.item-info { | ||
padding: 2px 0px; | ||
} | ||
`; |
Oops, something went wrong.