-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* feat: complete 컴포넌트 퍼블리싱 * feat: 오류 타입 선택 퍼블리싱 * feat: 오류 제보 상세설명 뷰 퍼블리싱 * feat: 디테일 뷰 연결 * feat: 공백일 때의 조건 추가 * feat: toast message 구현 * chore: asset 추가 * chore: props 수정 * chore: 함수 변경 (reporttype) * chore: 어셋 수정사항 적용 * chore: pnpm-lock.yaml 변경 * feat: textarea 리사이징 방지 * feat: debounce 초 변경
- Loading branch information
Showing
15 changed files
with
617 additions
and
14 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
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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,56 @@ | ||
import { css, keyframes } from '@emotion/react'; | ||
import { useEffect } from 'react'; | ||
|
||
import { CheckFilledYellowIcon } from '@/assets/icon'; | ||
import { COLORS, FONTS } from '@/styles/constants'; | ||
|
||
interface ToastMessageProps { | ||
children: string; | ||
setToast: React.Dispatch<React.SetStateAction<boolean>>; | ||
} | ||
|
||
const ToastMessage = (props: ToastMessageProps) => { | ||
const { children, setToast } = props; | ||
|
||
useEffect(() => { | ||
const timer = setTimeout(() => { | ||
setToast(false); | ||
}, 3000); | ||
return () => { | ||
clearTimeout(timer); | ||
}; | ||
}, [setToast]); | ||
|
||
return ( | ||
<div css={toastMessageContainer}> | ||
<CheckFilledYellowIcon /> | ||
<span>{children}</span> | ||
</div> | ||
); | ||
}; | ||
|
||
export default ToastMessage; | ||
|
||
const fadeout = keyframes` | ||
0% {opacity:1}; | ||
100% {opacity:0}; | ||
`; | ||
|
||
const toastMessageContainer = () => css` | ||
display: flex; | ||
gap: 1.2rem; | ||
align-items: center; | ||
width: 100%; | ||
padding: 1.7rem 0 1.7rem 2.4rem; | ||
border-radius: 1.6rem; | ||
background-color: ${COLORS.brand1}; | ||
color: ${COLORS.white}; | ||
${FONTS.Body2}; | ||
font-weight: 400; | ||
animation: ${fadeout} 1.5s forwards; | ||
animation-delay: 1.2s; | ||
`; |
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,119 @@ | ||
import { css } from '@emotion/react'; | ||
import { useState } from 'react'; | ||
import { useNavigate } from 'react-router-dom'; | ||
|
||
import { XMonoIcon } from '@/assets/icon'; | ||
import { ErrorReportCompleteImage } from '@/assets/image'; | ||
import ToastMessage from '@/components/ToastMessage'; | ||
import { COLORS, FONTS } from '@/styles/constants'; | ||
|
||
const Complete = () => { | ||
const navigate = useNavigate(); | ||
const [toast, setToast] = useState(true); | ||
|
||
return ( | ||
<div css={completeContainer}> | ||
<header css={header}> | ||
<XMonoIcon onClick={() => navigate(-1)} /> | ||
</header> | ||
|
||
<div css={mainContainer}> | ||
<section css={contentContainer}> | ||
<img src={ErrorReportCompleteImage} alt="" css={image} /> | ||
<div css={text('main')}> | ||
<h1>등록 완료!</h1> | ||
<h1>소중한 제보 감사해요</h1> | ||
</div> | ||
<p css={text('sub')}>문의해주신 내용은 확인 후</p> | ||
<p css={text('sub')}>반영 여부가 결정돼요</p> | ||
</section> | ||
|
||
<div css={bottomContainer}> | ||
{toast && ( | ||
<ToastMessage | ||
setToast={() => { | ||
setToast; | ||
}}> | ||
등록이 완료되었습니다. | ||
</ToastMessage> | ||
)} | ||
<button type="button" css={button} onClick={() => navigate(-1)}> | ||
확인 | ||
</button> | ||
</div> | ||
</div> | ||
</div> | ||
); | ||
}; | ||
|
||
export default Complete; | ||
|
||
const completeContainer = css` | ||
display: flex; | ||
flex-direction: column; | ||
width: 100%; | ||
`; | ||
|
||
const header = css` | ||
display: flex; | ||
justify-content: flex-end; | ||
align-items: center; | ||
width: 100%; | ||
height: 4.8rem; | ||
`; | ||
|
||
const mainContainer = css` | ||
display: flex; | ||
justify-content: space-between; | ||
flex-direction: column; | ||
width: 100%; | ||
height: calc(100dvh - 4.8rem); | ||
padding-bottom: 1.2rem; | ||
`; | ||
|
||
const contentContainer = css` | ||
display: flex; | ||
align-items: center; | ||
flex-direction: column; | ||
height: 27rem; | ||
margin-top: 2.8rem; | ||
`; | ||
|
||
const image = css` | ||
width: 11.8rem; | ||
height: 11.8rem; | ||
margin-bottom: 3.2rem; | ||
`; | ||
|
||
const text = (variant: string) => css` | ||
margin-bottom: ${variant === 'main' ? '0.8rem' : 0}; | ||
color: ${variant === 'main' ? COLORS.gray9 : COLORS.gray6}; | ||
text-align: center; | ||
${variant === 'main' ? FONTS.H3 : FONTS.Body5}; | ||
`; | ||
|
||
const bottomContainer = css` | ||
display: flex; | ||
gap: 0.8rem; | ||
flex-direction: column; | ||
width: 100%; | ||
`; | ||
|
||
const button = css` | ||
width: 100%; | ||
padding: 1.7rem 15.35rem; | ||
border-radius: 1.2rem; | ||
background-color: ${COLORS.brand1}; | ||
color: ${COLORS.white}; | ||
${FONTS.Body2}; | ||
`; |
Oops, something went wrong.