mirror of
https://github.com/chenasraf/DefinitelyTyped.git
synced 2026-05-18 01:49:01 +00:00
🤖 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:
@@ -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> {}
|
||||
|
||||
@@ -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
|
||||
}
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user