Skip to content

Commit 8c2c135

Browse files
Toast styling (#35)
* fix: toast styling * chore: version bump
1 parent 83cfa7e commit 8c2c135

3 files changed

Lines changed: 15 additions & 5 deletions

File tree

packages/ui/CHANGELOG.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,11 @@
11
# @hoodieshq/ms-tools-ui
22

3+
## 0.8.2
4+
5+
### Patch Changes
6+
7+
- Toast component styling
8+
39
## 0.8.1
410

511
### Patch Changes

packages/ui/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@hoodieshq/ms-tools-ui",
3-
"version": "0.8.1",
3+
"version": "0.8.2",
44
"description": "Reusable React components built with React, Tailwind CSS, and Shadcn, forming the visual building blocks of microsites",
55
"main": ".",
66
"types": "./dist/index.d.ts",

packages/ui/src/components/sonner.tsx

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,17 @@
1-
import { useTheme } from 'next-themes'
21
import { Toaster as Sonner, ToasterProps } from 'sonner'
2+
import { cn } from '@/lib/utils'
33

44
const Toaster = ({ ...props }: ToasterProps) => {
5-
const { theme = 'system' } = useTheme()
6-
75
return (
86
<Sonner
9-
theme={theme as ToasterProps['theme']}
107
className="toaster group"
8+
toastOptions={{
9+
className: cn(
10+
'!px-4 !py-2',
11+
'data-[type=success]:!bg-accent-secondary data-[type=success]:!border-accent-secondary data-[type=success]:!text-foreground',
12+
'data-[type=error]:!bg-destructive data-[type=error]:!border-destructive data-[type=error]:!text-foreground'
13+
),
14+
}}
1115
style={
1216
{
1317
'--normal-bg': 'var(--popover)',

0 commit comments

Comments
 (0)