Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: replace toaster with sonner #19342

Open
wants to merge 62 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 61 commits
Commits
Show all changes
62 commits
Select commit Hold shift + click to select a range
a1e242b
fix: replace react-hot-toast with sonner for toast notifications
nayan-bagale Feb 11, 2025
c00566d
Merge branch 'main' into replace-toaster-with-sonner
PeerRich Feb 12, 2025
f3428eb
Merge branch 'main' into replace-toaster-with-sonner
nayan-bagale Feb 12, 2025
d7fb481
feat: add country code (#19264)
Udit-takkar Feb 12, 2025
2eba2e4
perf: Move PlainChat up the hierarchy to remove rerenders (#19255)
hbjORbj Feb 12, 2025
0418315
hotfix (#19266)
alishaz-polymath Feb 12, 2025
14381b0
chore: release v4.9.11
invalid-email-address Feb 12, 2025
d6567e9
Handle cancelled status (#19272)
joeauyeung Feb 13, 2025
7f6e18e
feat: Use new /routing URL for routing forms (#19235)
hariombalhara Feb 13, 2025
e47dd76
fix: remove section on /bookings if no data exists (#19261)
eunjae-lee Feb 13, 2025
94f79a2
feat: v2 slots new version (#18758)
supalarry Feb 13, 2025
620ae1e
refactor: remove depreceated fields (#19279)
Udit-takkar Feb 13, 2025
a05cf2c
chore: Refactor to remove `getServerSideProps` for /teams route (#19286)
hbjORbj Feb 13, 2025
3927026
chore: release v4.9.12
invalid-email-address Feb 13, 2025
3dd0efe
fix: Salesforce - if no contact throw Error (#19271)
joeauyeung Feb 13, 2025
570d6a8
fix: missing await router controller (#19276)
ThyMinimalDev Feb 13, 2025
fbcb5e2
fix: Default people filter in bookings list for admin (#18035)
vijayraghav-io Feb 14, 2025
7c210a5
feat: add CSAT to V2 bookings return (#19278)
alishaz-polymath Feb 14, 2025
d8d5d12
chore: disable v2 booking seats safe parse error logs (#19292)
supalarry Feb 14, 2025
97eb289
revert: Reapply "fix: Multiple rr-hosts combine to create erroneous a…
emrysal Feb 14, 2025
3d2cd00
chore: release v4.9.13
invalid-email-address Feb 14, 2025
713f9ef
fix: flaky test (#19294)
Udit-takkar Feb 14, 2025
3f0e1fc
chore: calendars controller v2 docs (#19291)
ThyMinimalDev Feb 14, 2025
f979dfe
Merge branch 'main' into replace-toaster-with-sonner
nayan-bagale Feb 18, 2025
53a10d2
add ireland country code (#19117)
CarinaWolli Feb 15, 2025
7befd04
perf: separate client vs server code from insights layout (#19285)
hbjORbj Feb 15, 2025
922f2d9
feat: Use Folders to organize SMS links on Dub (#19248)
steven-tey Feb 15, 2025
2570fa4
fix: removing-all-members-toggle-for-fh (#19277)
TusharBhatt1 Feb 15, 2025
073ea13
chore: release v5.0.0
invalid-email-address Feb 15, 2025
fcb0926
fix flake (#19306)
anikdhabal Feb 16, 2025
33b7e1b
chore: migrate `/apps/routing-forms/[...pages]` to App Router (#18956)
hbjORbj Feb 17, 2025
07f98b3
chore: migrate api for team upgrade to App Router (#19100)
hbjORbj Feb 17, 2025
a86e92a
fix: cut off and alignment bug (#19317)
retrogtx Feb 17, 2025
397025f
fix: nested scrolls on /bookings (#19284)
eunjae-lee Feb 17, 2025
96be0a6
fix: Can't change availability for managed event type (#19006)
anikdhabal Feb 17, 2025
eedf763
fix: bulk-update-in-scheduleId-in-detailed-view (#19295)
TusharBhatt1 Feb 17, 2025
3841c9e
feat: prevent automatic query parameters when opening booking page (#…
sanchitttt Feb 17, 2025
791a05a
feat: atoms adjustments with ui v3 styles (#19320)
Ryukemeister Feb 17, 2025
a3b9b38
refactor: Clean out old code, no longer needed (#19323)
emrysal Feb 17, 2025
c08ffa8
chore: release v5.0.1
invalid-email-address Feb 17, 2025
9e2faea
feat: Create `UserCreationService` and use in API V1 create user endp…
joeauyeung Feb 18, 2025
582e2e1
fix (#19298)
anikdhabal Feb 18, 2025
da18c8c
fix: timezone input text is now visible in dark mode (#19325)
retrogtx Feb 18, 2025
29a818d
feat: make first tab active by default (#19315)
retrogtx Feb 18, 2025
4485776
perf: Use one PageWrapper instance for all settings pages (#18752)
hbjORbj Feb 18, 2025
e5cb0cd
fix: Can't use unsaved booking question as variable in event name (#1…
Amit91848 Feb 18, 2025
4a0fe9b
chore: remove WithLayout from not-found.tsx (#19331)
hbjORbj Feb 18, 2025
83f0bf8
fix: redirect logic in /settings/admin/apps (#19332)
hbjORbj Feb 18, 2025
9de42a9
chore: v3 fixed filters, new profile view (#19312)
PeerRich Feb 18, 2025
c10dbad
fix: Issues with date changes in column view (#19258)
anikdhabal Feb 18, 2025
412e0eb
chore: fixed tooltip position for routing form (#19267)
PeerRich Feb 18, 2025
e81b792
fix: Fairness when routing (#18550)
emrysal Feb 18, 2025
74a71eb
fix: EditLocationDialog footer positioning and structure (#19335)
retrogtx Feb 18, 2025
7cc28ae
Merge branch 'main' into replace-toaster-with-sonner
nayan-bagale Feb 18, 2025
a1eed42
Merge branch 'replace-toaster-with-sonner' into chore-replace-toaster…
nayan-bagale Feb 18, 2025
228cde9
Merge branch 'main' into chore-replace-toaster-with-sonner
nayan-bagale Feb 18, 2025
b61fe24
chore: remove DefaultToast from toast.stories.mdx
nayan-bagale Feb 19, 2025
cfb2711
Merge branch 'main' into chore-replace-toaster-with-sonner
PeerRich Feb 19, 2025
9960fd4
Merge branch 'main' into chore-replace-toaster-with-sonner
retrogtx Feb 19, 2025
2ee9523
Merge branch 'main' into chore-replace-toaster-with-sonner
nayan-bagale Feb 19, 2025
07638db
Merge branch 'main' into chore-replace-toaster-with-sonner
nayan-bagale Feb 19, 2025
daa41d6
Merge branch 'main' into chore-replace-toaster-with-sonner
TusharBhatt1 Feb 21, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
import { usePathname, useRouter } from "next/navigation";
import { useEffect, useMemo, useRef, useState } from "react";
import { useForm } from "react-hook-form";
import { Toaster } from "react-hot-toast";
import { Toaster } from "sonner";
import type { z } from "zod";

import checkForMultiplePaymentApps from "@calcom/app-store/_utils/payments/checkForMultiplePaymentApps";
Expand Down
2 changes: 1 addition & 1 deletion apps/web/modules/auth/verify-email-change-view.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import { useSession } from "next-auth/react";
import { useRouter } from "next/navigation";
import { useEffect } from "react";
import React from "react";
import { Toaster } from "react-hot-toast";
import { Toaster } from "sonner";

import { useLocale } from "@calcom/lib/hooks/useLocale";
import type { inferSSRProps } from "@calcom/types/inferSSRProps";
Expand Down
2 changes: 1 addition & 1 deletion apps/web/modules/bookings/views/bookings-single-view.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ import { useSession } from "next-auth/react";
import Link from "next/link";
import { usePathname, useRouter } from "next/navigation";
import { Fragment, useEffect, useState } from "react";
import { Toaster } from "react-hot-toast";
import { RRule } from "rrule";
import { Toaster } from "sonner";
import { z } from "zod";

import BookingPageTagManager from "@calcom/app-store/BookingPageTagManager";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import { signOut } from "next-auth/react";
import type { TFunction } from "next-i18next";
import { usePathname, useRouter } from "next/navigation";
import { Suspense } from "react";
import { Toaster } from "react-hot-toast";
import { Toaster } from "sonner";
import { z } from "zod";

import { classNames } from "@calcom/lib";
Expand Down
2 changes: 1 addition & 1 deletion apps/web/modules/signup-view.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import Script from "next/script";
import { useState, useEffect } from "react";
import type { SubmitHandler } from "react-hook-form";
import { useForm, useFormContext } from "react-hook-form";
import { Toaster } from "react-hot-toast";
import { Toaster } from "sonner";
import { z } from "zod";

import getStripe from "@calcom/app-store/stripepayment/lib/client";
Expand Down
2 changes: 1 addition & 1 deletion apps/web/modules/users/views/users-public-view.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
import classNames from "classnames";
import type { InferGetServerSidePropsType } from "next";
import Link from "next/link";
import { Toaster } from "react-hot-toast";
import { Toaster } from "sonner";

import {
sdkActionManager,
Expand Down
2 changes: 1 addition & 1 deletion apps/web/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,6 @@
"react-dom": "^18.2.0",
"react-easy-crop": "^3.5.2",
"react-hook-form": "^7.43.3",
"react-hot-toast": "^2.3.0",
"react-intl": "^5.25.1",
"react-live-chat-loader": "^2.8.1",
"react-multi-email": "^0.5.3",
Expand All @@ -140,6 +139,7 @@
"sanitize-html": "^2.10.0",
"schema-dts": "^1.1.0",
"short-uuid": "^4.2.0",
"sonner": "^1.7.4",
"stripe": "^9.16.0",
"superjson": "1.9.1",
"tailwindcss-radix": "^2.6.0",
Expand Down
2 changes: 1 addition & 1 deletion packages/app-store/alby/pages/setup/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { auth, Client, webln } from "@getalby/sdk";
import Link from "next/link";
import { useRouter } from "next/navigation";
import { useState, useCallback, useEffect } from "react";
import { Toaster } from "react-hot-toast";
import { Toaster } from "sonner";

import AppNotInstalledMessage from "@calcom/app-store/_components/AppNotInstalledMessage";
import { useCompatSearchParams } from "@calcom/lib/hooks/useCompatSearchParams";
Expand Down
2 changes: 1 addition & 1 deletion packages/app-store/applecalendar/pages/setup/index.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { useRouter } from "next/navigation";
import { useState } from "react";
import { useForm } from "react-hook-form";
import { Toaster } from "react-hot-toast";
import { Toaster } from "sonner";

import { APP_NAME } from "@calcom/lib/constants";
import { useLocale } from "@calcom/lib/hooks/useLocale";
Expand Down
2 changes: 1 addition & 1 deletion packages/app-store/caldavcalendar/pages/setup/index.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { useRouter } from "next/navigation";
import { useState } from "react";
import { useForm } from "react-hook-form";
import { Toaster } from "react-hot-toast";
import { Toaster } from "sonner";

import { useLocale } from "@calcom/lib/hooks/useLocale";
import { Alert, Button, Form, TextField } from "@calcom/ui";
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { useRouter } from "next/navigation";
import { useState } from "react";
import { useForm } from "react-hook-form";
import { Toaster } from "react-hot-toast";
import { Toaster } from "sonner";

import { useLocale } from "@calcom/lib/hooks/useLocale";
import { Alert, Button, Form, TextField } from "@calcom/ui";
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { useRouter } from "next/navigation";
import { useState } from "react";
import { useForm } from "react-hook-form";
import { Toaster } from "react-hot-toast";
import { Toaster } from "sonner";

import { useLocale } from "@calcom/lib/hooks/useLocale";
import { Alert, Button, Form, TextField } from "@calcom/ui";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { zodResolver } from "@hookform/resolvers/zod";
import { useRouter } from "next/navigation";
import { useState } from "react";
import { Controller, useForm } from "react-hook-form";
import { Toaster } from "react-hot-toast";
import { Toaster } from "sonner";
import z from "zod";

import { emailSchema } from "@calcom/lib/emailSchema";
Expand Down
2 changes: 1 addition & 1 deletion packages/app-store/hitpay/pages/setup/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import Link from "next/link";
import { useRouter } from "next/navigation";
import { useState, useEffect } from "react";
import { useForm } from "react-hook-form";
import { Toaster } from "react-hot-toast";
import { Toaster } from "sonner";
import { z } from "zod";

import AppNotInstalledMessage from "@calcom/app-store/_components/AppNotInstalledMessage";
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { useRouter } from "next/navigation";
import { useState } from "react";
import { useForm } from "react-hook-form";
import { Toaster } from "react-hot-toast";
import { Toaster } from "sonner";

import { useLocale } from "@calcom/lib/hooks/useLocale";
import { Alert, Button, Form, TextField, CheckboxField } from "@calcom/ui";
Expand Down
2 changes: 1 addition & 1 deletion packages/app-store/make/pages/setup/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import type { InferGetServerSidePropsType } from "next";
import { Trans } from "next-i18next";
import Link from "next/link";
import { useState } from "react";
import { Toaster } from "react-hot-toast";
import { Toaster } from "sonner";

import AppNotInstalledMessage from "@calcom/app-store/_components/AppNotInstalledMessage";
import { useLocale } from "@calcom/lib/hooks/useLocale";
Expand Down
2 changes: 1 addition & 1 deletion packages/app-store/paypal/pages/setup/index.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { useRouter } from "next/navigation";
import { useState } from "react";
import { Toaster } from "react-hot-toast";
import { Toaster } from "sonner";

import AppNotInstalledMessage from "@calcom/app-store/_components/AppNotInstalledMessage";
import { useLocale } from "@calcom/lib/hooks/useLocale";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
import { useRouter } from "next/navigation";
import type { FormEvent } from "react";
import { useEffect, useRef, useState } from "react";
import { Toaster } from "react-hot-toast";
import { Toaster } from "sonner";
import { v4 as uuidv4 } from "uuid";

import { sdkActionManager, useIsEmbed } from "@calcom/embed-core/embed-iframe";
Expand Down
2 changes: 1 addition & 1 deletion packages/app-store/sendgrid/pages/setup/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { zodResolver } from "@hookform/resolvers/zod";
import { useRouter } from "next/navigation";
import { useEffect, useState } from "react";
import { Controller, useForm } from "react-hook-form";
import { Toaster } from "react-hot-toast";
import { Toaster } from "sonner";
import z from "zod";

import { useLocale } from "@calcom/lib/hooks/useLocale";
Expand Down
2 changes: 1 addition & 1 deletion packages/app-store/zapier/pages/setup/index.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { Trans } from "next-i18next";
import Link from "next/link";
import { useState } from "react";
import { Toaster } from "react-hot-toast";
import { Toaster } from "sonner";

import AppNotInstalledMessage from "@calcom/app-store/_components/AppNotInstalledMessage";
import { useLocale } from "@calcom/lib/hooks/useLocale";
Expand Down
2 changes: 1 addition & 1 deletion packages/features/bookings/Booker/Booker.tsx
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import { AnimatePresence, LazyMotion, m } from "framer-motion";
import dynamic from "next/dynamic";
import { useEffect, useMemo, useRef } from "react";
import { Toaster } from "react-hot-toast";
import StickyBox from "react-sticky-box";
import { Toaster } from "sonner";
import { shallow } from "zustand/shallow";

import BookingPageTagManager from "@calcom/app-store/BookingPageTagManager";
Expand Down
2 changes: 1 addition & 1 deletion packages/features/shell/Shell.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import { useSession } from "next-auth/react";
import { usePathname, useRouter } from "next/navigation";
import type { Dispatch, ReactElement, ReactNode, SetStateAction } from "react";
import React, { cloneElement } from "react";
import { Toaster } from "react-hot-toast";
import { Toaster } from "sonner";

import { useRedirectToLoginIfUnauthenticated } from "@calcom/features/auth/lib/hooks/useRedirectToLoginIfUnauthenticated";
import { useRedirectToOnboardingIfNeeded } from "@calcom/features/auth/lib/hooks/useRedirectToOnboardingIfNeeded";
Expand Down
2 changes: 1 addition & 1 deletion packages/lib/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,8 @@
"jimp": "^0.16.1",
"next-collect": "^0.2.1",
"next-i18next": "^13.2.2",
"react-hot-toast": "^2.3.0",
"rrule": "^2.7.1",
"sonner": "^1.7.4",
"tailwind-merge": "^1.13.2",
"tsdav": "2.0.3",
"tslog": "^4.9.2",
Expand Down
49 changes: 21 additions & 28 deletions packages/ui/components/toast/showToast.tsx
Original file line number Diff line number Diff line change
@@ -1,21 +1,19 @@
import classNames from "classnames";
import type { ToastOptions, Toast } from "react-hot-toast";
import toast from "react-hot-toast";
import type { ToastT } from "sonner";
import { toast } from "sonner";

import { Icon } from "../icon";

type IToast = {
message: string;
toastVisible: boolean;
toastId: string;
onClose: (toastId: string) => void;
toastId: string | number;
onClose: (toastId: string | number) => void;
};

export const SuccessToast = ({ message, toastVisible, onClose, toastId }: IToast) => (
export const SuccessToast = ({ message, onClose, toastId }: IToast) => (
<button
className={classNames(
"data-testid-toast-success bg-default dark:bg-inverted text-emphasis dark:text-inverted shadow-elevation-low border-subtle mb-2 flex h-auto space-x-2 rounded-lg border px-3 py-2.5 text-sm font-semibold rtl:space-x-reverse md:max-w-sm",
toastVisible && "animate-fade-in-up cursor-pointer"
"data-testid-toast-success bg-default dark:bg-inverted text-emphasis dark:text-inverted shadow-elevation-low border-subtle mb-2 flex h-auto space-x-2 rounded-lg border px-3 py-2.5 text-sm font-semibold rtl:space-x-reverse md:max-w-sm"
)}
onClick={() => onClose(toastId)}>
<span className="mt-0.5">
Expand All @@ -30,11 +28,10 @@ export const SuccessToast = ({ message, toastVisible, onClose, toastId }: IToast
</button>
);

export const ErrorToast = ({ message, toastVisible, onClose, toastId }: IToast) => (
export const ErrorToast = ({ message, onClose, toastId }: IToast) => (
<button
className={classNames(
"animate-fade-in-up bg-semantic-error-subtle text-semantic-error shadow-elevation-low border-semantic-error-subtle mb-2 flex h-auto space-x-2 rounded-md border px-3 py-2.5 text-sm font-semibold rtl:space-x-reverse md:max-w-sm",
toastVisible && "animate-fade-in-up cursor-pointer"
"animate-fade-in-up bg-semantic-error-subtle text-semantic-error shadow-elevation-low border-semantic-error-subtle mb-2 flex h-auto space-x-2 rounded-md border px-3 py-2.5 text-sm font-semibold rtl:space-x-reverse md:max-w-sm"
)}
onClick={() => onClose(toastId)}>
<span className="mt-0.5">
Expand All @@ -49,11 +46,10 @@ export const ErrorToast = ({ message, toastVisible, onClose, toastId }: IToast)
</button>
);

export const WarningToast = ({ message, toastVisible, onClose, toastId }: IToast) => (
export const WarningToast = ({ message, onClose, toastId }: IToast) => (
<button
className={classNames(
"animate-fade-in-up bg-semantic-attention-subtle text-semantic-attention shadow-elevation-low border-semantic-attention-subtle mb-2 flex h-auto space-x-2 rounded-md border px-3 py-2.5 text-sm font-semibold rtl:space-x-reverse md:max-w-sm",
toastVisible && "animate-fade-in-up cursor-pointer"
"animate-fade-in-up bg-semantic-attention-subtle text-semantic-attention shadow-elevation-low border-semantic-attention-subtle mb-2 flex h-auto space-x-2 rounded-md border px-3 py-2.5 text-sm font-semibold rtl:space-x-reverse md:max-w-sm"
)}
onClick={() => onClose(toastId)}>
<span className="mt-0.5">
Expand All @@ -76,28 +72,25 @@ export function showToast(
message: string,
variant: ToastVariants,
// Options or duration (duration for backwards compatibility reasons)
options: number | ToastOptions = TOAST_VISIBLE_DURATION
options: number | ToastT = TOAST_VISIBLE_DURATION
) {
//
const _options: ToastOptions = typeof options === "number" ? { duration: options } : options;
const _options: ToastT = typeof options === "number" ? { duration: options, id: "" } : options;
if (!_options.duration) _options.duration = TOAST_VISIBLE_DURATION;
if (!_options.position) _options.position = "bottom-center";

const onClose = (toastId: string) => {
toast.remove(toastId);
const onClose = (toastId: string | number) => {
toast.dismiss(toastId);
};
const toastElements: { [x in ToastVariants]: (t: Toast) => JSX.Element } = {
success: (t) => (
<SuccessToast message={message} toastVisible={t.visible} onClose={onClose} toastId={t.id} />
),
error: (t) => <ErrorToast message={message} toastVisible={t.visible} onClose={onClose} toastId={t.id} />,
warning: (t) => (
<WarningToast message={message} toastVisible={t.visible} onClose={onClose} toastId={t.id} />
),

const toastElements: { [x in ToastVariants]: (t: number | string) => JSX.Element } = {
success: (toastId) => <SuccessToast message={message} onClose={onClose} toastId={toastId} />,
error: (toastId) => <ErrorToast message={message} onClose={onClose} toastId={toastId} />,
warning: (toastId) => <WarningToast message={message} onClose={onClose} toastId={toastId} />,
};

return toast.custom(
toastElements[variant] ||
((t) => <SuccessToast message={message} toastVisible={t.visible} onClose={onClose} toastId={t.id} />),
((toastId) => <SuccessToast message={message} onClose={onClose} toastId={toastId} />),
_options
);
}
32 changes: 13 additions & 19 deletions packages/ui/components/toast/toast.stories.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,9 @@ import {
VariantRow,
} from "@calcom/storybook/components";

import { SuccessToast, ErrorToast, WarningToast, DefaultToast } from "./";
import { SuccessToast, ErrorToast, WarningToast } from "./";

<Meta title="UI/Toasts" component={DefaultToast} />
<Meta title="UI/Toasts" component={SuccessToast} />

<Title title="Toasts" suffix="Brief" subtitle="Version 2.0 — Last Update: 22 Aug 2022" />

Expand All @@ -24,43 +24,37 @@ Toasts are used to show an action has had a impact. If a user submits a form a t

## Structure

<CustomArgsTable of={DefaultToast} />
<CustomArgsTable of={SuccessToast} />

<Examples title="Toasts">
<Example title="Default">
<DefaultToast message="Default Toast" toastVisible={true} />
</Example>
<Example title="Success">
<SuccessToast message="Success Toast" toastVisible={true} />
<SuccessToast message="Success Toast" />
</Example>
<Example title="Warning">
<WarningToast message="Warning Toast" toastVisible={true} />
<WarningToast message="Warning Toast" />
</Example>
<Example title="Error">
<ErrorToast message="Error Toast" toastVisible={true} />
<ErrorToast message="Error Toast" />
</Example>
</Examples>

## Toast Story

<Canvas>
<Story
name="Default"
name="Toast Variants"
args={{
message: "Default Toast",
toastVisible: true,
message: "Toast Message",
}}
argTypes={{
message: { control: "text" },
toastVisible: { control: "boolean" },
}}>
{({ message, toastVisible }) => (
<VariantsTable titles={["Default", "Success", "Warning", "Error"]} columnMinWidth={150}>
<VariantRow variant="Default">
<DefaultToast message={message} toastVisible={toastVisible} />
<SuccessToast message={message} toastVisible={toastVisible} />
<WarningToast message={message} toastVisible={toastVisible} />
<ErrorToast message={message} toastVisible={toastVisible} />
<VariantsTable titles={["Success", "Warning", "Error"]} columnMinWidth={150}>
<VariantRow variant="Success">
<SuccessToast message={message} />
<WarningToast message={message} />
<ErrorToast message={message} />
</VariantRow>
</VariantsTable>
)}
Expand Down
2 changes: 1 addition & 1 deletion packages/ui/components/toast/toast.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ describe("Tests for Toast Components", () => {
const toastId = "some-id";

const onCloseMock = vi.fn();
render(<Component message={message} toastVisible={true} onClose={onCloseMock} toastId={toastId} />);
render(<Component message={message} onClose={onCloseMock} toastId={toastId} />);

const toast = screen.getByTestId(toastTestId);
expect(toast).toBeInTheDocument();
Expand Down
2 changes: 1 addition & 1 deletion packages/ui/layouts/WizardLayout.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
import { noop } from "lodash";
import { usePathname } from "next/navigation";
import React, { useEffect, useState } from "react";
import { Toaster } from "react-hot-toast";
import { Toaster } from "sonner";

import { APP_NAME } from "@calcom/lib/constants";
import { useLocale } from "@calcom/lib/hooks/useLocale";
Expand Down
Loading