mirror of
https://github.com/aykhans/slash-e.git
synced 2025-12-16 05:29:20 +00:00
feat: use react-hot-toast
This commit is contained in:
@@ -1,9 +1,9 @@
|
||||
import { Button, Input, Modal, ModalDialog, Radio, RadioGroup } from "@mui/joy";
|
||||
import { useEffect, useState } from "react";
|
||||
import { toast } from "react-hot-toast";
|
||||
import { shortcutService } from "../services";
|
||||
import useLoading from "../hooks/useLoading";
|
||||
import Icon from "./Icon";
|
||||
import toastHelper from "./Toast";
|
||||
|
||||
interface Props {
|
||||
workspaceId: WorkspaceId;
|
||||
@@ -76,7 +76,7 @@ const CreateShortcutDialog: React.FC<Props> = (props: Props) => {
|
||||
|
||||
const handleSaveBtnClick = async () => {
|
||||
if (!state.shortcutCreate.name) {
|
||||
toastHelper.error("Name is required");
|
||||
toast.error("Name is required");
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -100,7 +100,7 @@ const CreateShortcutDialog: React.FC<Props> = (props: Props) => {
|
||||
}
|
||||
} catch (error: any) {
|
||||
console.error(error);
|
||||
toastHelper.error(JSON.stringify(error.response.data));
|
||||
toast.error(JSON.stringify(error.response.data));
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user