-
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.
Browse files
Browse the repository at this point in the history
…ionError Fix/#138/admin navigation error
- Loading branch information
Showing
26 changed files
with
117 additions
and
44 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,5 @@ | ||
import { get } from '@/api/index'; | ||
|
||
const draw = () => get('/admin/topPrizeWinner'); | ||
|
||
export { draw }; |
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
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,46 @@ | ||
import React, { useState } from 'react'; | ||
import AdminEditHeader from '@/components/header/AdminEditHeader'; | ||
import BlackButton from '@/components/buttons/BlackButton'; | ||
import ModalFrame from '@/components/modal/ModalFrame'; | ||
import { draw } from '@/api/DrawCasper/index'; | ||
|
||
function DrawCasper() { | ||
const [openSubmitModal, setOpenSubmitModal] = useState(false); | ||
const [winner, setWinner] = useState(''); | ||
|
||
const handleSubmit = async () => { | ||
try { | ||
const response = await draw(); | ||
setWinner(response.phoneNumber); | ||
} catch (error) { | ||
console.error(error); | ||
} finally { | ||
setOpenSubmitModal(false); | ||
} | ||
}; | ||
|
||
return ( | ||
<div className="w-full mt-10"> | ||
<AdminEditHeader info="1등 경품 추첨" /> | ||
<div className="set-center h-[400px] w-full bg-neutral-white rounded-b-[10px] py-4"> | ||
{winner === '' ? ( | ||
<BlackButton | ||
value="추첨하기" | ||
onClickFunc={() => setOpenSubmitModal(true)} | ||
/> | ||
) : ( | ||
<div className="text-heading-banner-title-3">{winner}</div> | ||
)} | ||
</div> | ||
{openSubmitModal && ( | ||
<ModalFrame | ||
text="정말로 추첨하시겠습니까??" | ||
onClickNo={() => setOpenSubmitModal(false)} | ||
onClickYes={() => handleSubmit()} | ||
/> | ||
)} | ||
</div> | ||
); | ||
} | ||
|
||
export default DrawCasper; |
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
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
Oops, something went wrong.