Skip to content

Instantly share code, notes, and snippets.

@aaronblondeau
Created August 27, 2017 02:38
Show Gist options
  • Save aaronblondeau/949ffaf5b9bf07268d398092c04e1257 to your computer and use it in GitHub Desktop.
Save aaronblondeau/949ffaf5b9bf07268d398092c04e1257 to your computer and use it in GitHub Desktop.
Use a Card and Image to display item image
import React, { Component } from 'react';
import {
StyleSheet,
} from 'react-native';
import { Image } from 'react-native';
import { Container, Content, Button, Text, Icon, Card, CardItem, Left, Body } from 'native-base';
import {observer} from 'mobx-react';
import applicationState from '../ApplicationState'
import { NavigationActions } from 'react-navigation'
@observer
export default class DetailScreen extends Component {
static navigationOptions = ({ navigation }) => ({
title: navigation.state.params.thing.name,
});
render() {
const { dispatch } = this.props.navigation;
const { params } = this.props.navigation.state;
const backAction = NavigationActions.back({});
return (
<Container>
<Content>
<Card>
<CardItem>
<Left>
<Body>
<Text note>{params.thing.description}</Text>
</Body>
</Left>
</CardItem>
<CardItem cardBody>
<Image source={{ uri: params.thing.thumbnail }} style={{height: 200, width: null, flex: 1}}/>
</CardItem>
</Card>
</Content>
</Container>
);
}
}
const styles = StyleSheet.create({
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment