-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
5 changed files
with
96 additions
and
38 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 |
---|---|---|
@@ -0,0 +1,41 @@ | ||
import React from 'react'; | ||
import { useNavigate } from 'react-router-dom'; | ||
|
||
export default function ConfirmAlert({ | ||
setIsConfirm, | ||
}: { | ||
setIsConfirm: React.Dispatch<React.SetStateAction<boolean>>; | ||
}) { | ||
const navigate = useNavigate(); | ||
return ( | ||
<div | ||
className="absolute top-0 z-50 flex size-full items-center justify-center bg-black/30 px-4" | ||
onClick={() => setIsConfirm(false)} | ||
> | ||
<div className="flex w-full flex-col gap-6 rounded-[20px] bg-white py-4"> | ||
<div className="flex flex-col gap-1 pt-4"> | ||
<div className="text-center text-lg font-bold"> | ||
변경 사항을 취소 하시겠어요? | ||
</div> | ||
<div className="text-center text-sm"> | ||
수정하신 내용이 반영되지 않아요. | ||
</div> | ||
</div> | ||
<div className="flex gap-4 px-4 text-sm"> | ||
<div | ||
className="w-1/2 rounded-lg bg-gray-200 py-3 text-center active:opacity-80" | ||
onClick={() => navigate(-1)} | ||
> | ||
수정 취소 | ||
</div> | ||
<div | ||
className="w-1/2 rounded-lg bg-success py-3 text-center text-white" | ||
onClick={() => setIsConfirm(false)} | ||
> | ||
계속 편집 | ||
</div> | ||
</div> | ||
</div> | ||
</div> | ||
); | ||
} |
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
39 changes: 39 additions & 0 deletions
39
src/pages/Goods/components/GoodsNoticeModify/components/NoticeModifyHeader.tsx
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,39 @@ | ||
import React from 'react'; | ||
import ChevronLeft from '@src/asset/icon/chevronLeft.svg'; | ||
import { useNavigate } from 'react-router-dom'; | ||
|
||
export default function NoticeModifyHeader({ | ||
curr, | ||
prev, | ||
setIsConfirm, | ||
rightMenu, | ||
}: { | ||
curr: string; | ||
prev: string; | ||
setIsConfirm: React.Dispatch<React.SetStateAction<boolean>>; | ||
rightMenu: JSX.Element; | ||
}) { | ||
const navigate = useNavigate(); | ||
|
||
const handleGoingBack = () => { | ||
if (curr === prev) { | ||
// console.log('변동사항 없음'); | ||
navigate(-1); | ||
} else { | ||
// console.log('변동사항 있음'); | ||
setIsConfirm(true); | ||
} | ||
}; | ||
return ( | ||
<div className="absolute left-1/2 top-0 z-50 flex h-[48px] w-full max-w-screen-sm -translate-x-1/2 items-center justify-between bg-white px-4"> | ||
<button onClick={handleGoingBack}> | ||
<img | ||
className="h-12 w-10 cursor-pointer px-1 py-2" | ||
src={ChevronLeft} | ||
alt="뒤로가기" | ||
/> | ||
</button> | ||
{rightMenu} | ||
</div> | ||
); | ||
} |
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