Skip to content

Instantly share code, notes, and snippets.

@perryraskin
Created September 12, 2019 01:13
Show Gist options
  • Save perryraskin/6e156df06570b71ed7d09317bda03e55 to your computer and use it in GitHub Desktop.
Save perryraskin/6e156df06570b71ed7d09317bda03e55 to your computer and use it in GitHub Desktop.
Me.js vs Details.js
import React, { Component } from 'react';
import { ScrollView, Button, View, Text } from 'react-native';
import { createStackNavigator, createAppContainer } from 'react-navigation';
import { Header, Actions, Info } from '../components/UserDetails/';
import colors from '../config/colors';
class Details extends Component {
render() {
const contact = this.props.navigation.state.params;
return (
<ScrollView style={{ backgroundColor: colors.background }}>
<Header {...contact} />
<Actions {...contact} />
<Info {...contact} />
<Button
title="Go back"
onPress={() => this.props.navigation.goBack(null)}
/>
</ScrollView>
);
}
}
export default Details;
import React, { Component } from 'react';
import { View, Text, ScrollView } from 'react-native';
import { Header, Actions, Info } from '../components/UserDetails';
import colors from '../config/colors';
import { me } from '../config/data';
import { PrimaryButton } from '../components/Buttons';
class Me extends Component {
render() {
return (
<ScrollView style={{ backgroundColor: colors.background }}>
<Header {...me} />
<PrimaryButton
label="Edit Profile"
onPress={() => null}
/>
<Actions {...me} />
<Info {...me} />
</ScrollView>
);
}
}
export default Me;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment