diff options
author | Eric Bailey <git@esb.lol> | 2025-08-14 09:51:40 -0500 |
---|---|---|
committer | GitHub <noreply@github.com> | 2025-08-14 09:51:40 -0500 |
commit | 7b2e61bf4dd1e10ade956b2ac091dbb44d41d525 (patch) | |
tree | a29f4b3543bb4846e97af2d4425e311c86826947 /src/components/Toast/Toast.tsx | |
parent | 221623f55aa6c1bbe699c8d409832da110923c76 (diff) | |
download | voidsky-7b2e61bf4dd1e10ade956b2ac091dbb44d41d525.tar.zst |
Integrate Sonner for toasts (#8839)
* Integrate Sonner for toasts * Fix animation on iOS * Refactor API * Update e2e file
Diffstat (limited to 'src/components/Toast/Toast.tsx')
-rw-r--r-- | src/components/Toast/Toast.tsx | 15 |
1 files changed, 8 insertions, 7 deletions
diff --git a/src/components/Toast/Toast.tsx b/src/components/Toast/Toast.tsx index 908b470a4..28220cb8d 100644 --- a/src/components/Toast/Toast.tsx +++ b/src/components/Toast/Toast.tsx @@ -13,6 +13,11 @@ type ContextType = { type: ToastType } +export type ToastComponentProps = { + type?: ToastType + content: React.ReactNode +} + export const ICONS = { default: CircleCheck, success: CircleCheck, @@ -26,13 +31,7 @@ const Context = createContext<ContextType>({ }) Context.displayName = 'ToastContext' -export function Toast({ - type, - content, -}: { - type: ToastType - content: React.ReactNode -}) { +export function Toast({type = 'default', content}: ToastComponentProps) { const {fonts} = useAlf() const t = useTheme() const styles = useToastStyles({type}) @@ -90,10 +89,12 @@ export function ToastText({children}: {children: React.ReactNode}) { const {textColor} = useToastStyles({type}) return ( <Text + selectable={false} style={[ a.text_md, a.font_bold, a.leading_snug, + a.pointer_events_none, { color: textColor, }, |