Skip to content

Commit

Permalink
feat(ConnectResultToast): add toast icons
Browse files Browse the repository at this point in the history
  • Loading branch information
BrickheadJohnny committed Dec 10, 2024
1 parent 039f5dc commit ff0f21a
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/components/ConnectResultToast.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
"use client";

import { CheckCircle, XCircle } from "@phosphor-icons/react/dist/ssr";
import { usePathname, useRouter, useSearchParams } from "next/navigation";
import { useCallback, useEffect } from "react";
import { toast } from "sonner";
Expand Down Expand Up @@ -27,14 +28,17 @@ export const ConnectResultToast = () => {

useEffect(() => {
if (!connectSuccessPlatform) return;
toast(`Successfully connected ${connectSuccessPlatform}!`);
toast(`Successfully connected ${connectSuccessPlatform}!`, {
icon: <CheckCircle weight="fill" className="text-icon-success" />,
});
removeSearchParam(SUCCESS_PARAM);
}, [connectSuccessPlatform, removeSearchParam]);

useEffect(() => {
if (!connectErrorMessage) return;
toast("Error", {
description: connectErrorMessage,
icon: <XCircle weight="fill" className="text-icon-error" />,
});
removeSearchParam(ERROR_MSG_PARAM);
}, [connectErrorMessage, removeSearchParam]);
Expand Down

0 comments on commit ff0f21a

Please sign in to comment.