30 lines
698 B
TypeScript
30 lines
698 B
TypeScript
import { Toaster as SonnerToaster } from "sonner-native"
|
|
|
|
import { radius, useIsDark, useThemeColors } from "@/lib/theme"
|
|
|
|
export function Toaster() {
|
|
const isDark = useIsDark()
|
|
const themeColors = useThemeColors()
|
|
|
|
return (
|
|
<SonnerToaster
|
|
position="top-center"
|
|
theme={isDark ? "dark" : "light"}
|
|
toastOptions={{
|
|
style: {
|
|
backgroundColor: themeColors.card,
|
|
borderColor: themeColors.border,
|
|
borderWidth: 1,
|
|
borderRadius: radius.lg,
|
|
},
|
|
titleStyle: {
|
|
color: themeColors.foreground,
|
|
},
|
|
descriptionStyle: {
|
|
color: themeColors.mutedForeground,
|
|
},
|
|
}}
|
|
/>
|
|
)
|
|
}
|