Skip to content

Commit

Permalink
fix: toast type
Browse files Browse the repository at this point in the history
Signed-off-by: Innei <[email protected]>
  • Loading branch information
Innei committed Feb 9, 2025
1 parent f7806d1 commit 7e07840
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 5 deletions.
1 change: 1 addition & 0 deletions src/components/ui/editor/Milkdown/plugins/Excalidraw.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -196,6 +196,7 @@ const ExcalidrawBoard: FC = () => {
)

const handleEdit = () => {
// eslint-disable-next-line @eslint-react/no-nested-components
const Content: FC<ModalContentPropsInternal> = () => {
const valueRef = useRef<string | undefined>(content)
const valueGetterRef = useRef(() => valueRef.current)
Expand Down
19 changes: 14 additions & 5 deletions src/lib/toast.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,11 +29,20 @@ const toast = {} as {
success: (
message: string,
options?: ExternalToast & CustomToastOptions,
) => void
info: (message: string, options?: ExternalToast & CustomToastOptions) => void
warn: (message: string, options?: ExternalToast & CustomToastOptions) => void
error: (message: string, options?: ExternalToast & CustomToastOptions) => void
dismiss: (id?: string) => void
) => ReturnType<typeof sonnerToast.success>
info: (
message: string,
options?: ExternalToast & CustomToastOptions,
) => ReturnType<typeof sonnerToast.info>
warn: (
message: string,
options?: ExternalToast & CustomToastOptions,
) => ReturnType<typeof sonnerToast.warning>
error: (
message: string,
options?: ExternalToast & CustomToastOptions,
) => ReturnType<typeof sonnerToast.error>
dismiss: (id?: string | number) => void
}
;['success', 'info', 'warn', 'error'].forEach((type) => {
// @ts-ignore
Expand Down

0 comments on commit 7e07840

Please sign in to comment.