import React, {Component} from 'react'; import {ScrollView, StyleSheet} from 'react-native'; import {Assets, Colors, View, Button, Text, Incubator} from 'react-native-ui-lib'; import {renderMultipleSegmentOptions, renderBooleanOption, renderRadioGroup} from '../ExampleScreenPresenter'; const {Toast} = Incubator; const TOAST_ACTIONS = { none: {}, label: {label: 'Undo', onPress: () => console.warn('undo')}, icon: {iconSource: Assets.icons.demo.plus, onPress: () => console.warn('add')} }; const TOAST_MESSAGES = { general: 'La formule Pass VIP illimité 5 mois est masquée', success: 'The action completed successfully.', failure: 'The action could not be completed.', offline: 'Check Your Internet Connection' }; class ToastsScreen extends Component { showToast = false; // keep this state in class instance for immediate response state = { visible: false, toastPosition: 'bottom' as Incubator.ToastProps['position'], isCustomContent: false, showLoader: false, selectedAction: 'none' as keyof typeof TOAST_ACTIONS, hasAttachment: false, selectedPreset: '' as Incubator.ToastProps['preset'] & '', isSwipeable: true }; toggleVisibility = () => { // Im using this for storing toast visible since setState is async and takes time to response this.showToast = !this.showToast; this.setState({ visible: this.showToast }); }; renderCustomContent = () => { return ( This is a custom content Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book. ); }; renderAboveToast = () => { return (