-
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.
Merge pull request #87 from Nubblee/design/toast-84
[Design] 토스트 컴포넌트 구현
- Loading branch information
Showing
3 changed files
with
43 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
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,30 @@ | ||
import 'react-toastify/dist/ReactToastify.css' | ||
import { toast, ToastContainer } from 'react-toastify' | ||
import styled from '@emotion/styled' | ||
|
||
export type toastType = 'success' | 'failed' | ||
|
||
export function ShowToast(message: string, toastType = 'success') { | ||
if (toastType === 'success') { | ||
toast.success(`${message}`, { | ||
autoClose: 2000, | ||
theme: 'dark', | ||
draggable: true, | ||
}) | ||
} else { | ||
toast.error(`${message}`, { | ||
autoClose: 2000, | ||
draggable: true, | ||
}) | ||
} | ||
} | ||
|
||
export default function Toast() { | ||
return <StyledToastContainer /> | ||
} | ||
|
||
export const StyledToastContainer = styled(ToastContainer)` | ||
.Toastify__toast { | ||
background-color: #3d3d3d; | ||
} | ||
` |
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