11import * as React from 'react' ;
2- import { Animated , View } from 'react-native' ;
2+ import { Animated } from 'react-native' ;
33
44import { Intent } from '../../constants/Intent' ;
55import { Theme , withTheme } from '../../theme' ;
6- import { Text } from '../Typography ' ;
6+ import { Alert } from '../Alert ' ;
77
88// Animation taken from https://medium.com/@norbajunior /react-native-facebook-and-instagram-like-top-bar-notifications-with-animated-api-43c48d0443dd
99export type ToastId = string ;
@@ -13,7 +13,6 @@ export interface ToastSettings {
1313 title ?: string ;
1414 description ?: string ;
1515 offset ?: number ;
16- duration ?: number ;
1716 /* custom component, will take precedence over title and description */
1817 component ?: React . ReactNode ;
1918 /* will override */
@@ -65,15 +64,7 @@ class ToastBase extends React.Component<ToastProps, ToastState> {
6564 }
6665
6766 public render ( ) {
68- const {
69- theme,
70- component,
71- title,
72- description,
73- intent = 'info' ,
74- } = this . props ;
75-
76- const { toastStyle, textStyle } = theme . getToastStyles ( intent ) ;
67+ const { component, title, description, intent = 'info' } = this . props ;
7768
7869 return (
7970 < Animated . View
@@ -82,12 +73,7 @@ class ToastBase extends React.Component<ToastProps, ToastState> {
8273 } }
8374 >
8475 { component || (
85- < View style = { toastStyle } >
86- < Text dangerouslySetInlineStyle = { { textStyle } } size = "large" >
87- { title }
88- </ Text >
89- < Text dangerouslySetInlineStyle = { { textStyle } } > { description } </ Text >
90- </ View >
76+ < Alert title = { title } description = { description } intent = { intent } />
9177 ) }
9278 </ Animated . View >
9379 ) ;
0 commit comments