feat: support gif toast (#3389)

This commit is contained in:
JimmFly
2023-07-27 13:37:18 +08:00
committed by GitHub
parent fa8086d525
commit bc27412425
5 changed files with 137 additions and 30 deletions

View File

@@ -12,6 +12,12 @@ export default {
} satisfies Meta<typeof NotificationCenter>;
let id = 0;
const image = (
<video autoPlay muted loop>
<source src="/editingVideo.mp4" type="video/mp4" />
<source src="/editingVideo.webm" type="video/webm" />
</video>
);
export const Basic = () => {
const push = useSetAtom(pushNotificationAtom);
const expand = useAtomValue(expandNotificationCenterAtom);
@@ -196,6 +202,27 @@ export const Basic = () => {
dark error
</button>
</div>
<div>
<button
onClick={() => {
const key = id++;
push({
key: `${key}`,
title: `${key} title`,
message: `gif test`,
type: 'info',
multimedia: image,
timeout: 3000,
undo: async () => {
console.log('undo');
},
progressingBar: true,
});
}}
>
gif
</button>
</div>
<NotificationCenter />
</>
);