-
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.
Merge branch 'dev' of https://github.com/CoolPeace-yanolza/frontend i…
…nto feature/#93
- Loading branch information
Showing
7 changed files
with
169 additions
and
24 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 |
---|---|---|
@@ -1,9 +1,17 @@ | ||
import { AxiosError } from 'axios'; | ||
|
||
import { LoginData } from '@/types/auth'; | ||
import { instance } from '..'; | ||
|
||
const postLogin = async (loginData: LoginData) => { | ||
const response = await instance.post('/v1/member/login', loginData); | ||
return response.data; | ||
try { | ||
const response = await instance.post('/v1/member/login', loginData); | ||
return response; | ||
} catch (error) { | ||
if (error instanceof AxiosError) { | ||
return error.response; | ||
} | ||
} | ||
}; | ||
|
||
export default postLogin; |
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,102 @@ | ||
import styled from '@emotion/styled'; | ||
|
||
import ErrorIcon from '@assets/icons/ic-error.svg'; | ||
import { ErrorModalProps } from '@/types/errorModal'; | ||
|
||
const ErrorModal = ({ modalContent, ButtonFunc }: ErrorModalProps) => { | ||
return ( | ||
<Backdrop> | ||
<Modal> | ||
<Icon | ||
src={ErrorIcon} | ||
alt="에러 아이콘" | ||
/> | ||
<Text>{modalContent.text}</Text> | ||
<ErrorText>{modalContent.errorText}</ErrorText> | ||
<ConfirmButton onClick={ButtonFunc}>확인</ConfirmButton> | ||
</Modal> | ||
</Backdrop> | ||
); | ||
}; | ||
|
||
export default ErrorModal; | ||
|
||
const Backdrop = styled.div` | ||
position: fixed; | ||
width: 100vw; | ||
height: 100vh; | ||
background: rgba(66, 66, 66, 0.5); | ||
z-index: 110; | ||
`; | ||
|
||
const Modal = styled.div` | ||
position: fixed; | ||
top: 50%; | ||
left: 50%; | ||
transform: translate(-50%, -50%); | ||
width: 517px; | ||
height: 249px; | ||
padding: 59px auto 32px; | ||
border-radius: 16px; | ||
display: flex; | ||
flex-direction: column; | ||
justify-content: center; | ||
align-items: center; | ||
background-color: #fff; | ||
box-shadow: 0px 5px 10px 5px rgba(0, 0, 0, 0.25); | ||
`; | ||
|
||
const Icon = styled.img` | ||
width: 28px; | ||
height: 28px; | ||
margin-bottom: 14px; | ||
`; | ||
|
||
const Text = styled.p` | ||
color: #404446; | ||
text-align: center; | ||
font-family: 'Noto Sans KR'; | ||
font-size: 15px; | ||
font-weight: 500; | ||
line-height: 22px; | ||
`; | ||
|
||
const ErrorText = styled.p` | ||
margin-bottom: 28px; | ||
color: #da1e28; | ||
text-align: center; | ||
font-family: 'Noto Sans KR'; | ||
font-size: 15px; | ||
font-weight: 700; | ||
line-height: 22px; | ||
`; | ||
|
||
const ConfirmButton = styled.button` | ||
width: 220px; | ||
height: 44px; | ||
border-radius: 12px; | ||
border: none; | ||
color: #fff; | ||
font-family: 'Noto Sans KR'; | ||
font-size: 18px; | ||
font-weight: 700; | ||
line-height: 32px; | ||
background-color: #1a2849; | ||
&:hover { | ||
background-color: #5f6980; | ||
cursor: pointer; | ||
} | ||
`; |
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,9 @@ | ||
export type ModalContent = { | ||
text: string; | ||
errorText: string; | ||
}; | ||
|
||
export type ErrorModalProps = { | ||
modalContent: ModalContent; | ||
ButtonFunc: () => void; | ||
}; |
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