Skip to content

Commit

Permalink
add style prop for images
Browse files Browse the repository at this point in the history
  • Loading branch information
mateuszpmroz committed Apr 10, 2020
1 parent 5eda44d commit 433899a
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/screens/MessageScreen.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import React from 'react';
import { Image, FastImageSource } from 'components/Image';
import { ButtonProps } from 'react-native-elements';
import { Text, View, StyleSheet } from 'react-native';
import { Text, View, StyleSheet, StyleProp, ViewStyle } from 'react-native';
import { useNavigationParam } from 'react-navigation-hooks';
import { Button } from 'components/Button';

Expand All @@ -12,18 +12,20 @@ export interface MessageProps {
source: FastImageSource;
description: string;
buttonProps?: ButtonProps;
imageStyle?: StyleProp<ViewStyle>;
}

export const MessageScreen = () => {
const title: string = useNavigationParam('title');
const source: FastImageSource = useNavigationParam('source');
const description: string = useNavigationParam('description');
const buttonProps: ButtonProps = useNavigationParam('buttonProps');
const imageStyle: StyleProp<ViewStyle> = useNavigationParam('imageStyle');

return (
<View style={styles.container}>
<Text style={styles.title}>{title}</Text>
<Image source={source} style={styles.image} resizeMode="contain" />
<Image source={source} style={[styles.image, imageStyle]} resizeMode="contain" />
<Text style={styles.description}>{description}</Text>
{buttonProps && <Button {...buttonProps} />}
</View>
Expand Down

0 comments on commit 433899a

Please sign in to comment.