Skip to content

Commit 5240802

Browse files
Merge pull request #145 from linked-planet/dev
fixed missing className forwarding to flag from toast flag
2 parents c3c775b + dd523bd commit 5240802

File tree

5 files changed

+351
-304
lines changed

5 files changed

+351
-304
lines changed

library/src/components/ToastFlag.tsx

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ import {
1616
ToastClose,
1717
} from "@radix-ui/react-toast"
1818
import { XIcon } from "lucide-react"
19-
import { twJoin } from "tailwind-merge"
19+
import { twJoin, twMerge } from "tailwind-merge"
2020
import { AnimatePresence, motion } from "motion/react"
2121

2222
type ToastFlagProps = FlagProps & {
@@ -128,6 +128,7 @@ function ToastFlag({
128128
icon,
129129
id,
130130
type = "inverted",
131+
className,
131132
...props
132133
}: ToastFlagProps) {
133134
const [paused, setPaused] = useState(false)
@@ -169,10 +170,14 @@ function ToastFlag({
169170
appearance={appearance}
170171
type={type}
171172
{...props}
172-
className={`border-none shadow-none ${autoClose && "pb-6"}`}
173+
className={twMerge(
174+
"border-none shadow-none",
175+
autoClose && "pb-6",
176+
className,
177+
)}
173178
/>
174179
<CloseButton
175-
inverted={type === "inverted"}
180+
inverted={type === "inverted" || type === "pale"}
176181
className="absolute top-2 right-2"
177182
/>
178183
{autoClose && (
@@ -241,6 +246,8 @@ function showFlag({
241246
}: ToastFlagProps) {
242247
const id = _id ?? crypto.randomUUID()
243248

249+
console.log("showFlag", id, type, appearance, props)
250+
244251
toastProxyMap.proxy.set(id, {
245252
appearance,
246253
type,

0 commit comments

Comments
 (0)