-
Notifications
You must be signed in to change notification settings - Fork 3
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 #107 from imi21123/test
Feat: modal 제작 완료, Header480에 영업 상태 변경 modal 연결
- Loading branch information
Showing
4 changed files
with
208 additions
and
77 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,85 +1,83 @@ | ||
import { useNavigate } from "react-router-dom"; | ||
import logo_txt from "../../../../assets/icons/Big_LOGO.svg"; | ||
import logo_cherry from "../../../../assets/icons/small_cherry.svg" | ||
import logo_cherry from "../../../../assets/icons/small_cherry.svg"; | ||
import "./HeaderMain.css"; | ||
import { useState } from "react"; | ||
const HeaderMain = () =>{ | ||
const navigate = useNavigate(); | ||
const [isOperation, setIsOperation] = useState(false);//가게 영업 상태를 받아와야합니다. | ||
//영업중/영업종료를 바꿔주는 핸들러 | ||
//해당 로직 필요함 | ||
const handleOperation = () => { | ||
setIsOperation((prev) => !prev); | ||
}; | ||
const isOperationBackground = isOperation | ||
const HeaderMain = () => { | ||
const navigate = useNavigate(); | ||
const [isOperation, setIsOperation] = useState(false); //가게 영업 상태를 받아와야합니다. | ||
//영업중/영업종료를 바꿔주는 핸들러 | ||
//해당 로직 필요함 | ||
const handleOperation = () => { | ||
setIsOperation((prev) => !prev); | ||
}; | ||
const isOperationBackground = isOperation | ||
? "rgba(216, 35, 86, 1)" | ||
: "rgba(131, 131, 131, 1)"; | ||
|
||
const OperationButton = () => { | ||
return ( | ||
<div className="loginControl-wrapper-css"> | ||
<span>{isOperation ? "영업 중" : "영업 종료"}</span> | ||
<div | ||
className="loginControl-button-wrapper-css" | ||
onClick={() => handleOperation()} | ||
style={{ backgroundColor: isOperationBackground }} | ||
> | ||
{isOperation ? ( | ||
<div className="loginControl-button-isopen-css"></div> | ||
) : ( | ||
<div className="loginControl-button-isclose-css"></div> | ||
)} | ||
</div> | ||
</div> | ||
); | ||
}; | ||
|
||
const OperationButton = () => { | ||
return ( | ||
<div className="loginControl-wrapper-css"> | ||
<span>{isOperation ? "영업 중" : "영업 종료"}</span> | ||
<div | ||
className="loginControl-button-wrapper-css" | ||
onClick={() => handleOperation()} | ||
style={{ backgroundColor: isOperationBackground }} | ||
> | ||
{isOperation ? ( | ||
<div className="loginControl-button-isopen-css"></div> | ||
) : ( | ||
<div className="loginControl-button-isclose-css"></div> | ||
)} | ||
</div> | ||
</div> | ||
); | ||
}; | ||
|
||
return( | ||
<header className="header-css"> | ||
<div className="headerTop-css"> | ||
<div className="headerTop-logo-wrapper-css" onClick={() => navigate("/")}> | ||
<img src={logo_cherry} alt="logo_cherry" className="headerTop-logo-cherry-css"/> | ||
<img src={logo_txt} alt="logoicon" className="headerTop-logo-txt-css"/> | ||
</div> | ||
return ( | ||
<header className="header-css"> | ||
<div className="headerTop-css"> | ||
<div | ||
className="headerTop-logo-wrapper-css" | ||
onClick={() => navigate("/")} | ||
> | ||
<img | ||
src={logo_cherry} | ||
alt="logo_cherry" | ||
className="headerTop-logo-cherry-css" | ||
/> | ||
<img | ||
src={logo_txt} | ||
alt="logoicon" | ||
className="headerTop-logo-txt-css" | ||
/> | ||
</div> | ||
|
||
<div className="headerTop-nav-css"> | ||
<ul className="headerTop-nav-right-css" > | ||
<li onClick={() => navigate("/")}> | ||
공지사항 | ||
</li> | ||
<li onClick={() => navigate("/")}> | ||
고객센터 | ||
</li> | ||
<li onClick={() => navigate("/mypage")}> | ||
마이페이지 | ||
</li> | ||
</ul> | ||
</div> | ||
</div> | ||
<div className="headerBottom-css"> | ||
<div className="headerBottom-nav-css"> | ||
<ul className="headerBottom-nav-left-css" > | ||
{/*경로 입력해주세요! */} | ||
<li onClick={() => navigate("/")}> | ||
매출관리 | ||
</li> | ||
<li onClick={() => navigate("/")}> | ||
매장관리 | ||
</li> | ||
<li onClick={() => navigate("/mypage")}> | ||
재고관리 | ||
</li> | ||
{/* 클릭안되게. */} | ||
<li > | ||
{/* <li onClick={() => navigate("/")}> */} | ||
고객관리(준비중) | ||
</li> | ||
</ul> | ||
</div> | ||
<OperationButton/> | ||
</div> | ||
</header> | ||
) | ||
} | ||
<div className="headerTop-nav-css"> | ||
<ul className="headerTop-nav-right-css"> | ||
<li onClick={() => navigate("/")}>공지사항</li> | ||
<li onClick={() => navigate("/")}>고객센터</li> | ||
<li onClick={() => navigate("/mypage")}>마이페이지</li> | ||
</ul> | ||
</div> | ||
</div> | ||
<div className="headerBottom-css"> | ||
<div className="headerBottom-nav-css"> | ||
<ul className="headerBottom-nav-left-css"> | ||
{/*경로 입력해주세요! */} | ||
<li onClick={() => navigate("/")}>매출관리</li> | ||
<li onClick={() => navigate("/")}>매장관리</li> | ||
<li onClick={() => navigate("/mypage")}>재고관리</li> | ||
{/* 클릭안되게. */} | ||
<li> | ||
{/* <li onClick={() => navigate("/")}> */} | ||
고객관리(준비중) | ||
</li> | ||
</ul> | ||
</div> | ||
<OperationButton /> | ||
</div> | ||
</header> | ||
); | ||
}; | ||
export default HeaderMain; |
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,89 @@ | ||
.modal__wrapper { | ||
position: fixed; | ||
top: 0; | ||
bottom: 0; | ||
left: 0; | ||
right: 0; | ||
|
||
z-index: 100; | ||
background: rgba(0, 0, 0, 0.5); | ||
} | ||
|
||
.modal__box { | ||
display: flex; | ||
flex-direction: column; | ||
justify-content: center; | ||
align-items: center; | ||
position: absolute; | ||
top: calc(50% - 8.5rem); | ||
left: calc(50% - 10.15625rem); | ||
width: 31.5rem; | ||
height: 24.3125rem; | ||
border-radius: 2.5rem; | ||
background: #fff; | ||
} | ||
|
||
.modal__close { | ||
width: 1.5rem; | ||
height: 1.5rem; | ||
margin-left: auto; | ||
margin-right: 2.19rem; | ||
} | ||
|
||
.modal__berry { | ||
width: 4.498rem; | ||
height: 4.498rem; | ||
transform: rotate(0.028deg); | ||
flex-shrink: 0; | ||
} | ||
|
||
.modal__title { | ||
color: #000; | ||
text-align: center; | ||
font-family: "Pretendard"; | ||
font-size: 1.5rem; | ||
font-style: normal; | ||
font-weight: 600; | ||
line-height: 130%; /* 1.95rem */ | ||
margin-top: 2.0625rem; | ||
margin-bottom: 5rem; | ||
} | ||
|
||
.modal__check { | ||
width: 11.4375rem; | ||
height: 1.875rem; | ||
flex-shrink: 0; | ||
border-radius: 0.625rem; | ||
background: #d82356; | ||
color: #fff; | ||
text-align: center; | ||
font-family: "Pretendard"; | ||
font-size: 1.125rem; | ||
font-style: normal; | ||
font-weight: 700; | ||
line-height: 130%; /* 1.4625rem */ | ||
letter-spacing: -0.01125rem; | ||
} | ||
|
||
@media (max-width: 480px) { | ||
.modal__box { | ||
width: 20.3125rem; | ||
height: 17.5rem; | ||
border-radius: 0.625rem; | ||
} | ||
|
||
.modal__close { | ||
width: 1.25rem; | ||
height: 1.25rem; | ||
} | ||
|
||
.modal__berry { | ||
width: 2.499rem; | ||
height: 2.499rem; | ||
} | ||
|
||
.modal__title { | ||
font-size: 1.25rem; | ||
letter-spacing: -0.0125rem; | ||
} | ||
} |
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,22 @@ | ||
import cherry from "../../../assets/icons/small_cherry.svg"; | ||
import X from "../../../assets/icons/X.svg"; | ||
import "./Modal.css"; | ||
|
||
const Modal = ({ handleCancle, handleCheck, title }) => { | ||
return ( | ||
<div className="modal__wrapper"> | ||
<div className="modal__box"> | ||
<img src={X} alt="X" className="modal__close" onClick={handleCancle} /> | ||
<div> | ||
<img src={cherry} alt="berry" className="modal__berry" /> | ||
</div> | ||
<div className="modal__title">{title}</div> | ||
<div className="modal__check" onClick={handleCheck}> | ||
확인 | ||
</div> | ||
</div> | ||
</div> | ||
); | ||
}; | ||
|
||
export default Modal; |