mirror of
https://github.com/vercel/commerce.git
synced 2025-07-26 03:31:23 +00:00
✨ feat: show message common
:%s
This commit is contained in:
@@ -1,35 +1,16 @@
|
||||
import { Layout, MessageCommon } from 'src/components/common'
|
||||
import { MessageItemProps } from 'src/components/common/MessageCommon/MessageItem/MessageItem'
|
||||
import { Layout } from 'src/components/common'
|
||||
import { useMessage } from 'src/components/contexts'
|
||||
|
||||
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 { showMessageSuccess } = useMessage()
|
||||
|
||||
const handleClick = () => {
|
||||
showMessageSuccess("Create account successfully")
|
||||
}
|
||||
|
||||
return (
|
||||
<>
|
||||
<MessageCommon messages={data} />
|
||||
{/* <MessageCommon type='error'>Create account successfully</MessageCommon>
|
||||
<MessageCommon type='info'>Create account successfully</MessageCommon>
|
||||
<MessageCommon type='warning'>Create account successfully</MessageCommon> */}
|
||||
<button onClick={handleClick}>Click me</button>
|
||||
</>
|
||||
)
|
||||
}
|
||||
|
Reference in New Issue
Block a user