🤖 Merge PR #65801 react-native-snackbar-component styles properties by @balsick

* react-native-snackbar-component positioning types

* fix: react-native-snackbar-component types
This commit is contained in:
Enrico Balsamo
2023-06-28 13:03:09 +02:00
committed by GitHub
parent b580df54c0
commit 10a8a995fc
2 changed files with 29 additions and 3 deletions

View File

@@ -6,7 +6,7 @@
// TypeScript Version: 2.8
import * as React from 'react';
import { Animated } from 'react-native';
import { Animated, TextStyle, ViewStyle } from 'react-native';
export interface SnackbarComponentProps {
accentColor?: string | undefined;
@@ -19,10 +19,13 @@ export interface SnackbarComponentProps {
right?: number | Animated.Value | undefined;
top?: number | Animated.Value | undefined;
bottom?: number | Animated.Value | undefined;
position?: string | undefined;
position?: 'bottom' | 'top' | undefined;
textMessage?: string | JSX.Element | undefined;
autoHidingTime?: number | undefined;
visible?: boolean | undefined;
containerStyle?: ViewStyle | undefined;
messageStyle?: TextStyle | undefined;
actionStyle?: TextStyle | undefined;
}
export default class SnackbarComponent extends React.Component<SnackbarComponentProps> {}

View File

@@ -1,5 +1,5 @@
import * as React from "react";
import { Animated, Text, View } from "react-native";
import { Animated, StyleSheet, Text, View } from "react-native";
import SnackbarComponent from "react-native-snackbar-component";
const SnackbarComponentTest = () => (
@@ -40,3 +40,26 @@ const WithAnimatedValues = () => {
visible={true}
/>);
};
const WithStyles = () => {
return (
<SnackbarComponent
actionText={"OPEN"}
textMessage={'Hello'}
position="top"
containerStyle={styles.container}
messageStyle={styles.message}
/>
);
};
const styles = StyleSheet.create({
container: {
backgroundColor: 'red',
flexDirection: 'row'
},
message: {
color: 'blue',
fontSize: 40
}
});