mirror of
https://github.com/toeverything/AFFiNE.git
synced 2026-07-21 20:16:26 +08:00
feat: support gif toast (#3389)
This commit is contained in:
@@ -9,6 +9,7 @@ import {
|
||||
ExportToPdfIcon,
|
||||
ExportToPngIcon,
|
||||
} from '@blocksuite/icons';
|
||||
import { uuidv4 } from '@blocksuite/store';
|
||||
import { useSetAtom } from 'jotai';
|
||||
import { useCallback } from 'react';
|
||||
|
||||
@@ -36,7 +37,7 @@ export const ExportToPdfMenuItem = ({
|
||||
.then(() => {
|
||||
onSelect?.({ type: 'pdf' });
|
||||
setPushNotification({
|
||||
key: 'export-to-pdf',
|
||||
key: uuidv4(),
|
||||
title: t['com.affine.export.success.title'](),
|
||||
message: t['com.affine.export.success.message'](),
|
||||
type: 'success',
|
||||
@@ -45,7 +46,7 @@ export const ExportToPdfMenuItem = ({
|
||||
.catch(err => {
|
||||
console.error(err);
|
||||
setPushNotification({
|
||||
key: 'export-to-pdf',
|
||||
key: uuidv4(),
|
||||
title: t['com.affine.export.error.title'](),
|
||||
message: t['com.affine.export.error.message'](),
|
||||
type: 'error',
|
||||
@@ -59,7 +60,7 @@ export const ExportToPdfMenuItem = ({
|
||||
.then(() => {
|
||||
onSelect?.({ type: 'pdf' });
|
||||
setPushNotification({
|
||||
key: 'export-to-pdf',
|
||||
key: uuidv4(),
|
||||
title: t['com.affine.export.success.title'](),
|
||||
message: t['com.affine.export.success.message'](),
|
||||
type: 'success',
|
||||
@@ -68,7 +69,7 @@ export const ExportToPdfMenuItem = ({
|
||||
.catch(err => {
|
||||
console.error(err);
|
||||
setPushNotification({
|
||||
key: 'export-to-pdf',
|
||||
key: uuidv4(),
|
||||
title: t['com.affine.export.error.title'](),
|
||||
message: t['com.affine.export.error.message'](),
|
||||
type: 'error',
|
||||
@@ -104,7 +105,7 @@ export const ExportToHtmlMenuItem = ({
|
||||
.then(() => {
|
||||
onSelect?.({ type: 'html' });
|
||||
setPushNotification({
|
||||
key: 'export-to-html',
|
||||
key: uuidv4(),
|
||||
title: t['com.affine.export.success.title'](),
|
||||
message: t['com.affine.export.success.message'](),
|
||||
type: 'success',
|
||||
@@ -112,6 +113,12 @@ export const ExportToHtmlMenuItem = ({
|
||||
})
|
||||
.catch(err => {
|
||||
console.error(err);
|
||||
setPushNotification({
|
||||
key: uuidv4(),
|
||||
title: t['com.affine.export.error.title'](),
|
||||
message: t['com.affine.export.error.message'](),
|
||||
type: 'error',
|
||||
});
|
||||
});
|
||||
onSelect?.({ type: 'html' });
|
||||
}, [currentEditor, onSelect, setPushNotification, t]);
|
||||
@@ -146,7 +153,7 @@ export const ExportToPngMenuItem = ({
|
||||
.then(() => {
|
||||
onSelect?.({ type: 'png' });
|
||||
setPushNotification({
|
||||
key: 'export-to-png',
|
||||
key: uuidv4(),
|
||||
title: t['com.affine.export.success.title'](),
|
||||
message: t['com.affine.export.success.message'](),
|
||||
type: 'success',
|
||||
@@ -155,7 +162,7 @@ export const ExportToPngMenuItem = ({
|
||||
.catch(err => {
|
||||
console.error(err);
|
||||
setPushNotification({
|
||||
key: 'export-to-png',
|
||||
key: uuidv4(),
|
||||
title: t['com.affine.export.error.title'](),
|
||||
message: t['com.affine.export.error.message'](),
|
||||
type: 'error',
|
||||
@@ -192,7 +199,7 @@ export const ExportToMarkdownMenuItem = ({
|
||||
.then(() => {
|
||||
onSelect?.({ type: 'markdown' });
|
||||
setPushNotification({
|
||||
key: 'export-to-markdown',
|
||||
key: uuidv4(),
|
||||
title: t['com.affine.export.success.title'](),
|
||||
message: t['com.affine.export.success.message'](),
|
||||
type: 'success',
|
||||
@@ -201,7 +208,7 @@ export const ExportToMarkdownMenuItem = ({
|
||||
.catch(err => {
|
||||
console.error(err);
|
||||
setPushNotification({
|
||||
key: 'export-to-markdown',
|
||||
key: uuidv4(),
|
||||
title: t['com.affine.export.error.title'](),
|
||||
message: t['com.affine.export.error.message'](),
|
||||
type: 'error',
|
||||
|
||||
Reference in New Issue
Block a user