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
const handleOnEndReached = () => { | |
if (data.organization.repositories.pageInfo.hasNextPage) | |
return fetchMore({ | |
variables: { | |
after: data.organization.repositories.pageInfo.endCursor, | |
first: 15, | |
}, | |
updateQuery: onUpdate, | |
}) | |
} |
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 { Text, SafeAreaView, View, FlatList, ActivityIndicator } from 'react-native' | |
import { useQuery, gql } from '@apollo/client' | |
import RepositoryItem from './components/RepositoryItem' | |
import styles from './styles' | |
const REPOSITORIES_QUERY = gql` | |
query($first: Int!) { | |
organization(login: "facebook") { | |
repositories(first: $first) { |
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
const { data, error, loading, fetchMore } = useQuery(REPOSITORIES_QUERY, { | |
variables: { first: 15 }, | |
}) |
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
#!/bin/bash | |
killall Xcode | |
xcrun -k | |
xcodebuild -alltargets clean | |
rm -rf "$(getconf DARWIN_USER_CACHE_DIR)/org.llvm.clang/ModuleCache" | |
rm -rf "$(getconf DARWIN_USER_CACHE_DIR)/org.llvm.clang.$(whoami)/ModuleCache" | |
rm -rf ~/Library/Developer/Xcode/DerivedData/* | |
rm -rf ~/Library/Caches/com.apple.dt.Xcode/* | |
open /Applications/Xcode.app |
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
export const pushScreen = props => { | |
const { componentId } = props; | |
Navigation.push(componentId, { | |
component: { | |
name: 'PushedScreen', | |
}, | |
}); | |
}; | |
export const openModal = () => { |
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
export const pushScreen = props => { | |
const { componentId } = props; | |
Navigation.push(componentId, { | |
component: { | |
name: 'PushedScreen', | |
}, | |
}); | |
}; | |
export const openModal = () => { |
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
// ModalScreen/styles.js | |
import {StyleSheet} from 'react-native'; | |
const styles = StyleSheet.create({ | |
container: { | |
flex: 1, | |
alignItems: 'center', | |
justifyContent: 'center', | |
backgroundColor: 'skyblue', | |
}, |
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
// ModalScreen/index.js | |
import React, {Component} from 'react'; | |
import {View, Text, TouchableOpacity} from 'react-native'; | |
import {Navigation} from 'react-native-navigation'; | |
import styles from './styles'; | |
class ModalScreen extends Component { | |
constructor(props) { | |
super(props); | |
Navigation.events().bindComponent(this); |
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 {View, Text, TouchableOpacity} from 'react-native'; | |
import {Navigation} from 'react-native-navigation'; | |
import styles from './styles'; | |
const pushScreen = props => { | |
const {componentId} = props; | |
Navigation.push(componentId, { | |
component: { | |
name: 'PushedScreen', |
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
// PushedScreen/index.js | |
import React from 'react'; | |
import {View, Text, TouchableOpacity} from 'react-native'; | |
import {Navigation} from 'react-native-navigation'; | |
import styles from './styles'; | |
const goBack = ({componentId}) => Navigation.pop(componentId); | |
const PushedScreen = props => { | |
return ( | |
<View style={styles.container}> |