-
Notifications
You must be signed in to change notification settings - Fork 4
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
김진영
authored and
김진영
committed
Nov 29, 2023
1 parent
912d45d
commit 8b03b59
Showing
1 changed file
with
118 additions
and
0 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,118 @@ | ||
'use client'; | ||
|
||
import Image from 'next/image'; | ||
import { styled } from 'styled-components'; | ||
import icCharDefault from 'public/assets/icons/ic_char_default.svg'; | ||
import { useState } from 'react'; | ||
import Link from 'next/link'; | ||
|
||
export default function finish() { | ||
const [isCheckedBefore, setIsCheckedBefore] = useState(true); | ||
const [isDoneSuccess, setIsDoneSuccess] = useState(false); | ||
|
||
const CheckSuccessHandler = (state: boolean): void => { | ||
setIsCheckedBefore(false); | ||
setIsDoneSuccess(state); | ||
}; | ||
|
||
return ( | ||
<Container> | ||
<TextArea> | ||
{isCheckedBefore === true ? ( | ||
<p> | ||
<b>막차</b>타고 집에 잘 도착했나요? | ||
</p> | ||
) : isDoneSuccess ? ( | ||
<p> | ||
오늘 내가 아낀 예상 택시비는 | ||
<br /> | ||
<b>40,200원</b>이에요 | ||
</p> | ||
) : ( | ||
<p> | ||
{' '} | ||
저런...! 오늘 내가 내야하는 예상 택시비는 | ||
<br /> | ||
<b>40,200원</b>이에요 | ||
</p> | ||
)} | ||
</TextArea> | ||
<Image | ||
src={icCharDefault} | ||
width={110} | ||
height={96} | ||
alt="막차타일러스트" | ||
priority | ||
/> | ||
<ButtonArea> | ||
{isCheckedBefore ? ( | ||
<ButtonWrapper> | ||
<button | ||
onClick={() => CheckSuccessHandler(true)} | ||
className="highlight" | ||
> | ||
네 도착했어요! | ||
</button> | ||
<button onClick={() => CheckSuccessHandler(false)}>아니요</button> | ||
</ButtonWrapper> | ||
) : isDoneSuccess ? ( | ||
<Link href="/" className="highlight"> | ||
내 통장을 지켜줘서 고마워 | ||
</Link> | ||
) : ( | ||
<Link href="/" className="highlight"> | ||
내 통장아 미안해 | ||
</Link> | ||
)} | ||
</ButtonArea> | ||
</Container> | ||
); | ||
} | ||
|
||
const Container = styled.div` | ||
width: 100%; | ||
height: 100vh; | ||
box-shadow: rgba(99, 99, 99, 0.2) 0px 2px 8px 0px; | ||
display: flex; | ||
flex-direction: column; | ||
justify-content: center; | ||
align-items: center; | ||
`; | ||
const TextArea = styled.div` | ||
width: 100%; | ||
height: 74px; | ||
font-size: 18px; | ||
line-height: 24px; | ||
text-align: center; | ||
margin-bottom: 42px; | ||
`; | ||
const ButtonArea = styled.div` | ||
width: 100%; | ||
padding: 0 16px; | ||
margin-top: 88px; | ||
& button, | ||
a { | ||
display: inline-block; | ||
width: 100%; | ||
background-color: #fff; | ||
border: 1px solid #888; | ||
border-radius: 14px; | ||
padding: 13px 0; | ||
text-align: center; | ||
} | ||
& .highlight, | ||
a { | ||
background-color: #ff8048; | ||
color: #fff; | ||
border: none; | ||
} | ||
`; | ||
const ButtonWrapper = styled.div` | ||
width: 100%; | ||
display: flex; | ||
gap: 12px; | ||
& button { | ||
width: 50%; | ||
} | ||
`; |