🎨 styles: message common

:%s
This commit is contained in:
lytrankieio123
2021-09-29 13:39:40 +07:00
parent 4776ec6236
commit 02cc226ba7
7 changed files with 201 additions and 14 deletions

View File

@@ -1,19 +1,35 @@
import { useEffect, useState } from 'react'
import {
ButtonCommon, Layout
} from 'src/components/common'
import { Layout, MessageCommon } from 'src/components/common'
import { MessageItemProps } from 'src/components/common/MessageCommon/MessageItem/MessageItem'
const data: MessageItemProps[] = [
{
id: 1,
content: 'Create account successfully',
type: 'error',
},
{
id: 2,
content: 'Create account successfully',
type: 'success',
},
{
id: 3,
content: 'Create account successfully',
type: 'warning',
},
{
id: 4,
content: 'Create account successfully',
type: 'info',
},
]
export default function Test() {
const [isLoading, setisLoading] = useState(false)
useEffect(() => {
setTimeout(() => {
setisLoading(true)
}, 3000)
}, [])
return (
<>
<ButtonCommon loading={isLoading}>Back to home</ButtonCommon>
<ButtonCommon type='light' loading={isLoading}>Back to home</ButtonCommon>
<ButtonCommon type='ghost' loading={isLoading}>Back to home</ButtonCommon>
<MessageCommon messages={data} />
{/* <MessageCommon type='error'>Create account successfully</MessageCommon>
<MessageCommon type='info'>Create account successfully</MessageCommon>
<MessageCommon type='warning'>Create account successfully</MessageCommon> */}
</>
)
}