This file contains hidden or 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
| export default createPaginationContainer(LinkList, | |
| { | |
| viewer: graphql` | |
| fragment LinkList_viewer on Viewer { | |
| allLinks( | |
| filter: $filter, | |
| first: $count, | |
| after: $after, | |
| orderBy: createdAt_DESC | |
| ) @connection(key: "LinkList_allLinks") { |
This file contains hidden or 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
| const LinkListPageQuery = graphql` | |
| query LinkListPageQuery( | |
| $count: Int!, | |
| $filter: LinkFilter, | |
| $after: String, | |
| ) { | |
| viewer { | |
| ...LinkList_viewer | |
| } | |
| } |
This file contains hidden or 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
| _loadMore() { | |
| if (!this.props.relay.hasMore()) { | |
| console.log('Nothing more to load'); | |
| return | |
| } else if (this.props.relay.isLoading()) { | |
| console.log('Request is already pending'); | |
| return | |
| } | |
| this.props.relay.loadMore(ITEMS_PER_PAGE); |
This file contains hidden or 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
| _refetchConnection() { | |
| this.props.relay.refetchConnection(10,(e) => null, { | |
| filter: { | |
| description_contains: this.state.filterValue, | |
| } | |
| }); | |
| } |
This file contains hidden or 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 | |
| type Props = {} & ReduxProps & ReduxState | |
| const mapStateToProps = state => ({ | |
| user: state.user, | |
| }); | |
| const mapDispatchToProps = dispatch => ({ | |
| actions: { | |
| logout: () => dispatch(logout()), |
This file contains hidden or 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 YourCoolComponent extends Component { | |
| constructor(props) { | |
| super(props); | |
| this.state = { | |
| counter: 0, | |
| }; | |
| this.add = this.add.bind(this); | |
| } | |
This file contains hidden or 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 YourCoolComponent extends Component { | |
| state = { | |
| counter: 0, | |
| } | |
| add = () => { | |
| this.setState(prevState => ({ counter: prevState.counter + 1 })); | |
| } | |
| render () { |
This file contains hidden or 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> |
OlderNewer