From 641c8e7015bf564f96f81089e1c419a9e4a26760 Mon Sep 17 00:00:00 2001 From: Kevin Latino <111583322+KevinLatino@users.noreply.github.com> Date: Sat, 1 Feb 2025 12:24:41 -0600 Subject: [PATCH] Feat/adding toaster (#115) --- apps/web/package.json | 1 + .../features/SelectionTypeCard.tsx | 12 +++++++++- apps/web/src/app/layout.tsx | 23 ++++++++++++++++++- 3 files changed, 34 insertions(+), 2 deletions(-) diff --git a/apps/web/package.json b/apps/web/package.json index ef03efc..74ccc86 100644 --- a/apps/web/package.json +++ b/apps/web/package.json @@ -40,6 +40,7 @@ "pinata-web3": "^0.5.3", "react": "^18.3.1", "react-dom": "^18.3.1", + "react-hot-toast": "^2.5.1", "react-i18next": "^15.0.2", "server-only": "^0.0.1", "starknet": "^6.11.0", diff --git a/apps/web/src/app/_components/features/SelectionTypeCard.tsx b/apps/web/src/app/_components/features/SelectionTypeCard.tsx index a3ac1b9..3623b24 100644 --- a/apps/web/src/app/_components/features/SelectionTypeCard.tsx +++ b/apps/web/src/app/_components/features/SelectionTypeCard.tsx @@ -2,6 +2,7 @@ import Button from "@repo/ui/button"; import { InfoCard } from "@repo/ui/infoCard"; import { Text } from "@repo/ui/typography"; import { useState } from "react"; +import toast from "react-hot-toast"; import { useTranslation } from "react-i18next"; interface SelectionTypeCardProps { @@ -42,6 +43,11 @@ export function SelectionTypeCard({ }, ]; + const handleAddToCart = () => { + onAddToCart(); + toast.success("Product added to cart successfully!"); + }; + return (
@@ -82,7 +88,11 @@ export function SelectionTypeCard({
-
diff --git a/apps/web/src/app/layout.tsx b/apps/web/src/app/layout.tsx index 7f6d953..5bb763c 100644 --- a/apps/web/src/app/layout.tsx +++ b/apps/web/src/app/layout.tsx @@ -1,8 +1,9 @@ "use client"; - import { useEffect } from "react"; +import { Toaster } from "react-hot-toast"; import "~/styles/globals.css"; import "~/i18n"; +import { CheckCircleIcon } from "@heroicons/react/20/solid"; import { GeistSans } from "geist/font/sans"; import { SessionProvider } from "next-auth/react"; import i18n from "~/i18n"; @@ -34,6 +35,26 @@ export default function RootLayout({ {children} + , + }, + error: { + style: { + backgroundColor: "#E9F1EF", + color: "#3B3E3F", + }, + icon: , + }, + }} + /> );