Skip to content

Commit 3628890

Browse files
committed
Toast style now matches the design
1 parent c2b5386 commit 3628890

File tree

2 files changed

+18
-8
lines changed

2 files changed

+18
-8
lines changed

apps/webapp/app/components/primitives/Toast.tsx

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ import { useTypedLoaderData } from "remix-typedjson";
66
import { loader } from "~/root";
77
import { useEffect } from "react";
88
import { Paragraph } from "./Paragraph";
9+
import { cn } from "~/utils/cn";
910

1011
const defaultToastDuration = 5000;
1112
const permanentToastDuration = 60 * 60 * 24 * 1000;
@@ -39,23 +40,27 @@ export function ToastUI({
3940
}) {
4041
return (
4142
<div
42-
className={`self-end rounded-md border border-grid-bright bg-background-dimmed`}
43+
className={cn(
44+
"self-end rounded-md border border-grid-bright bg-background-dimmed",
45+
variant === "success" && "border-success",
46+
variant === "error" && "border-error"
47+
)}
4348
style={{
4449
width: toastWidth,
4550
}}
4651
>
4752
<div className="flex w-full items-start gap-2 rounded-lg p-3">
4853
{variant === "success" ? (
49-
<CheckCircleIcon className="mt-1 h-6 min-h-[1.5rem] w-6 min-w-[1.5rem] text-green-600" />
54+
<CheckCircleIcon className="mt-1 size-6 min-w-6 text-success" />
5055
) : (
51-
<ExclamationCircleIcon className="mt-1 h-6 w-6 min-w-[1.5rem] text-rose-600" />
56+
<ExclamationCircleIcon className="mt-1 size-6 min-w-6 text-error" />
5257
)}
53-
<Paragraph className="py-1 text-text-dimmed">{message}</Paragraph>
58+
<Paragraph className="py-1 text-text-bright">{message}</Paragraph>
5459
<button
5560
className="hover:bg-midnight-800 ms-auto rounded p-2 text-text-dimmed transition hover:text-text-bright"
5661
onClick={() => toast.dismiss(t)}
5762
>
58-
<XMarkIcon className="h-4 w-4" />
63+
<XMarkIcon className="size-4" />
5964
</button>
6065
</div>
6166
</div>

apps/webapp/app/routes/storybook.toast/route.tsx

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,15 +6,20 @@ export default function Story() {
66
return (
77
<div className="flex flex-col items-start gap-y-4 p-4">
88
<ToastUI variant="success" message="Success UI" t="-" />
9-
<ToastUI variant="error" message="Error UI" t="-" />
109
<ToastUI
1110
variant="success"
11+
message="This is a long success message that wraps over multiple lines so we can test the UI."
12+
t="-"
13+
/>
14+
<ToastUI variant="error" message="Error UI" t="-" />
15+
<ToastUI
16+
variant="error"
1217
message="This is a long error message that wraps over multiple lines so we can test the UI."
1318
t="-"
1419
/>
1520
<br />
1621
<Button
17-
variant="primary/large"
22+
variant="primary/medium"
1823
onClick={() =>
1924
toast.custom((t) => <ToastUI variant="success" message="Success" t={t as string} />, {
2025
duration: Infinity, // Prevents auto-dismissal for demo purposes
@@ -24,7 +29,7 @@ export default function Story() {
2429
Trigger success toast
2530
</Button>
2631
<Button
27-
variant="danger/large"
32+
variant="danger/medium"
2833
onClick={() =>
2934
toast.custom((t) => <ToastUI variant="error" message="Error" t={t as string} />, {
3035
duration: Infinity,

0 commit comments

Comments
 (0)