Update Constants.ts

This commit is contained in:
원더 2021-01-30 21:23:05 +09:00
parent e7b1973764
commit 3c956dba83
2 changed files with 21 additions and 0 deletions

14
components/Message.tsx Normal file
View File

@ -0,0 +1,14 @@
import { MessageColor } from '@utils/Constants'
const Message = ({ type, children }:MessageProps):JSX.Element => {
return <div className={`${MessageColor[type]} px-6 py-4 my-4 rounded-md text-base mx-auto w-full`}>
{children}
</div>
}
interface MessageProps{
type?: 'success' | 'error' | 'warning' | 'info'
children: JSX.Element | JSX.Element[] | string
}
export default Message

View File

@ -125,6 +125,13 @@ export const reportCats = [
'기타',
]
export const MessageColor = {
success: 'bg-green-200 text-green-800',
error: 'bg-red-200 text-red-800',
warning: 'bg-yellow-50 text-yellow-700',
info: 'bg-blue-200 text-blue-800'
}
export const BASE_URLs = {
api: 'https://discord.com/api',
cdn: 'https://cdn.discordapp.com'