Skip to content

Instantly share code, notes, and snippets.

@rgommezz
Last active June 26, 2017 23:35
Show Gist options
  • Save rgommezz/8cda5056c34235d6d8be1139dc433b05 to your computer and use it in GitHub Desktop.
Save rgommezz/8cda5056c34235d6d8be1139dc433b05 to your computer and use it in GitHub Desktop.
import React, { Component } from 'react';
import {
View,
ScrollView,
StyleSheet,
} from 'react-native';
import { ConnectivityRenderer } from 'react-native-offline';
// Rest of component imports ...
class EventDetailsScreen extends Component {
render() {
const { event } = this.props;
return (
<ScrollView style={styles.container}>
<EventCover uri={event.uri} />
<View style={styles.content}>
<EventBasicInformation
data={event.basicInfo}
/>
<ConnectivityRenderer>
{isConnected => isConnected && <EventLocation
address={event.fullAddress}
eventId={event.eventId}
/>}
</ConnectivityRenderer>
<EventDescription description={event.description} />
<ConnectivityRenderer>
{isConnected => <RsvpButtons disabled={!isConnected} />}
</ConnectivityRenderer>
</View>
<ConnectivityRenderer>
{isConnected => (
<SnackBar
message="You are currently offline, some features may be disabled"
predicate={!isConnected}
/>
)}
</ConnectivityRenderer>
</ScrollView>
);
}
}
export default EventDetailsScreen;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment