This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import React from 'react'; | |
import { ScrollView, TouchableOpacity } from 'react-native'; | |
import { createStackNavigator } from 'react-navigation'; | |
import { ListItem, Text } from 'react-native-elements'; | |
// USAGE COMPONENTS | |
import Avatar from './components/stories/Avatar.usage'; | |
const List = ({ navigation }) => ( | |
<ScrollView> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
AppRegistry.registerComponent('poormanStorybook', () => StorybookUIHMRRoot); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// @flow | |
import * as React from 'react'; | |
import hoistStatics from 'hoist-non-react-statics'; | |
import { QueryRenderer } from 'react-relay'; | |
import idx from 'idx'; | |
import Loading from '../components/common/Loading'; | |
import HandleNetworkError from '../components/common/HandleNetworkError'; | |
import environment from './Environment'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { Environment, Network, RecordSource, Store } from 'relay-runtime'; | |
import { GRAPHQL_ENDPOINT } from 'react-native-dotenv'; | |
import { AsyncStorage } from 'react-native'; | |
import { AUTH_TOKEN } from '../utils/constants'; | |
const environment = (endpoint: string = GRAPHQL_ENDPOINT) => { | |
const store = new Store(new RecordSource()); | |
const fetchQuery = async (operation, variables) => { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class App extends Component { | |
constructor() { | |
super(); | |
this.state = { | |
counter: 0, | |
} | |
this.setCounter = this.setCounter.bind(this); | |
} | |
setCounter() { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class App extends Component { | |
state = { | |
counter: 0, | |
} | |
setCounter = () => { | |
this.setState((prevState) => ({ | |
counter: prevState.counter + 1, | |
})); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
render() { | |
return ( | |
<div className="App"> | |
<h1>{this.props.title}</h1> | |
<p>{this.props.description}</p> | |
<p>Current count is {this.state.counter}</p> | |
<button onClick={this.setCounter}>Add</button> | |
</div> | |
) | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
render() { | |
const { title, description } = this.props; | |
return ( | |
<div className="App"> | |
<h1>{title}</h1> | |
<p>{description}</p> | |
<p>Current count is {this.state.counter}</p> | |
<button onClick={this.setCounter}>Add</button> | |
</div> | |
) |