diff options
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, }, |