react-native-toast-message 2.2.0 → 2.2.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -1,10 +1,9 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import { Text, View } from 'react-native';
|
|
2
|
+
import { Text, View, TouchableOpacity } from 'react-native';
|
|
3
3
|
import { getTestId } from '../utils/test-id';
|
|
4
4
|
import { styles } from './BaseToast.styles';
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
return (<Touchable testID={getTestId('TouchableContainer')} onPress={onPress} activeOpacity={activeOpacity} style={[styles.base, styles.leadingBorder, style]} {...touchableContainerProps}>
|
|
5
|
+
export function BaseToast({ text1, text2, onPress, activeOpacity = 1, style, touchableContainerProps, contentContainerStyle, contentContainerProps, text1Style, text1NumberOfLines = 1, text1Props, text2Style, text2NumberOfLines = 1, text2Props, renderLeadingIcon, renderTrailingIcon }) {
|
|
6
|
+
return (<TouchableOpacity testID={getTestId('TouchableContainer')} onPress={onPress} activeOpacity={activeOpacity} style={[styles.base, styles.leadingBorder, style]} {...touchableContainerProps}>
|
|
8
7
|
{renderLeadingIcon && renderLeadingIcon()}
|
|
9
8
|
<View testID={getTestId('ContentContainer')} style={[styles.contentContainer, contentContainerStyle]} {...contentContainerProps}>
|
|
10
9
|
{(text1?.length ?? 0) > 0 && (<Text testID={getTestId('Text1')} style={[styles.text1, text1Style]} numberOfLines={text1NumberOfLines} ellipsizeMode='tail' {...text1Props}>
|
|
@@ -15,5 +14,5 @@ export function BaseToast({ text1, text2, onPress, activeOpacity, style, touchab
|
|
|
15
14
|
</Text>)}
|
|
16
15
|
</View>
|
|
17
16
|
{renderTrailingIcon && renderTrailingIcon()}
|
|
18
|
-
</
|
|
17
|
+
</TouchableOpacity>);
|
|
19
18
|
}
|
|
@@ -9,7 +9,10 @@ export function translateYOutputRangeFor({ position, height, topOffset, bottomOf
|
|
|
9
9
|
const outputRange = position === 'bottom' ? additiveInverseArray(range) : range;
|
|
10
10
|
return outputRange;
|
|
11
11
|
}
|
|
12
|
-
const useNativeDriver = Platform.select({
|
|
12
|
+
const useNativeDriver = Platform.select({
|
|
13
|
+
ios: true,
|
|
14
|
+
default: false
|
|
15
|
+
});
|
|
13
16
|
export function useSlideAnimation({ position, height, topOffset, bottomOffset, keyboardOffset }) {
|
|
14
17
|
const animatedValue = React.useRef(new Animated.Value(0));
|
|
15
18
|
const { keyboardHeight } = useKeyboard();
|
package/package.json
CHANGED
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
/// <reference types="react" />
|
|
2
|
-
import { TouchableOpacityProps } from 'react-native';
|
|
3
|
-
import { ReactChildren } from '../types';
|
|
4
|
-
declare type TouchableProps = {
|
|
5
|
-
children: ReactChildren;
|
|
6
|
-
} & TouchableOpacityProps;
|
|
7
|
-
export declare function Touchable({ children, activeOpacity, ...rest }: TouchableProps): JSX.Element;
|
|
8
|
-
export {};
|