Skip to content

Instantly share code, notes, and snippets.

@aaronblondeau
Created June 29, 2017 21:58
Show Gist options
  • Save aaronblondeau/acefdb3afbda7bb55a101009e7f5a5fd to your computer and use it in GitHub Desktop.
Save aaronblondeau/acefdb3afbda7bb55a101009e7f5a5fd to your computer and use it in GitHub Desktop.
Initial version of where2ride ride detail screen
import React, { Component } from 'react';
import {
StyleSheet,
} from 'react-native';
import { Container, Content, Button, Text, Icon } from 'native-base';
import {observer} from 'mobx-react';
import applicationState from '../ApplicationState'
import { NavigationActions } from 'react-navigation'
@observer
export default class RideDetailScreen extends Component {
static navigationOptions = ({ navigation }) => ({
title: `Ride ${navigation.state.params.id}`,
});
render() {
const { dispatch } = this.props.navigation;
const { params } = this.props.navigation.state;
const backAction = NavigationActions.back({});
return (
<Container>
<Content>
<Text>TODO - details for ride with id {params.id}</Text>
<Button iconLeft light onPress={() => dispatch(backAction) }>
<Icon name='arrow-back' />
<Text>Close</Text>
</Button>
</Content>
</Container>
);
}
}
const styles = StyleSheet.create({
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment