Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add examples #37

Open
wants to merge 5 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions .all-contributorsrc
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,15 @@
"bug",
"ideas"
]
},
{
"login": "kriswep",
"name": "Christoph Benjamin Weber",
"avatar_url": "https://avatars2.githubusercontent.com/u/8836059?v=4",
"profile": "https://wetainment.com",
"contributions": [
"example"
]
}
]
}
1 change: 1 addition & 0 deletions .npmignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
node_modules
example-assets
flow-typed
examples
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -190,7 +190,7 @@ Thanks goes to these wonderful people ([emoji key](https://github.com/kentcdodds
<!-- prettier-ignore -->
| [<img src="https://avatars3.githubusercontent.com/u/3629876?v=4" width="100px;"/><br /><sub><b>Kurtis Kemple</b></sub>](https://twitter.com/kurtiskemple)<br />[💻](https://github.com/kkemple/react-native-sideswipe/commits?author=kkemple "Code") [📖](https://github.com/kkemple/react-native-sideswipe/commits?author=kkemple "Documentation") [📝](#blog-kkemple "Blogposts") | [<img src="https://avatars1.githubusercontent.com/u/1714673?v=4" width="100px;"/><br /><sub><b>Jason Brown</b></sub>](http://browniefed.com)<br />[💻](https://github.com/kkemple/react-native-sideswipe/commits?author=browniefed "Code") [🤔](#ideas-browniefed "Ideas, Planning, & Feedback") | [<img src="https://avatars1.githubusercontent.com/u/16436270?v=4" width="100px;"/><br /><sub><b>Akshay Kadam</b></sub>](https://twitter.com/deadcoder0904)<br />[📖](https://github.com/kkemple/react-native-sideswipe/commits?author=deadcoder0904 "Documentation") | [<img src="https://avatars1.githubusercontent.com/u/4272832?v=4" width="100px;"/><br /><sub><b>Santosh Venkatraman</b></sub>](https://github.com/onstash)<br />[💻](https://github.com/kkemple/react-native-sideswipe/commits?author=onstash "Code") | [<img src="https://avatars3.githubusercontent.com/u/3153663?v=4" width="100px;"/><br /><sub><b>Narendra N Shetty</b></sub>](https://twitter.com/narendra_shetty)<br />[🤔](#ideas-narendrashetty "Ideas, Planning, & Feedback") | [<img src="https://avatars1.githubusercontent.com/u/10658888?v=4" width="100px;"/><br /><sub><b>Zachary Gibson</b></sub>](https://twitter.com/zacharykeith_)<br />[🤔](#ideas-zachgibson "Ideas, Planning, & Feedback") | [<img src="https://avatars1.githubusercontent.com/u/1640318?v=4" width="100px;"/><br /><sub><b>Chris Geirman</b></sub>](http://www.frogquest.com)<br />[🐛](https://github.com/kkemple/react-native-sideswipe/issues?q=author%3Ageirman "Bug reports") [📖](https://github.com/kkemple/react-native-sideswipe/commits?author=geirman "Documentation") [🤔](#ideas-geirman "Ideas, Planning, & Feedback") |
| :---: | :---: | :---: | :---: | :---: | :---: | :---: |
| [<img src="https://avatars3.githubusercontent.com/u/3743054?v=4" width="100px;"/><br /><sub><b>Dan Sipple</b></sub>](https://github.com/sipplified)<br />[🐛](https://github.com/kkemple/react-native-sideswipe/issues?q=author%3Asipplified "Bug reports") [💻](https://github.com/kkemple/react-native-sideswipe/commits?author=sipplified "Code") | [<img src="https://avatars3.githubusercontent.com/u/337798?v=4" width="100px;"/><br /><sub><b>Brian B. Canin</b></sub>](http://www.briancanin.com)<br />[💻](https://github.com/kkemple/react-native-sideswipe/commits?author=cyphire "Code") [👀](#review-cyphire "Reviewed Pull Requests") | [<img src="https://avatars2.githubusercontent.com/u/1041237?v=4" width="100px;"/><br /><sub><b>Michael Sevestre</b></sub>](http://www.design2code.ca)<br />[🐛](https://github.com/kkemple/react-native-sideswipe/issues?q=author%3Amsevestre "Bug reports") [🤔](#ideas-msevestre "Ideas, Planning, & Feedback") [⚠️](https://github.com/kkemple/react-native-sideswipe/commits?author=msevestre "Tests") | [<img src="https://avatars2.githubusercontent.com/u/650099?v=4" width="100px;"/><br /><sub><b>Soheil Jadidian</b></sub>](https://github.com/jadidian)<br />[🐛](https://github.com/kkemple/react-native-sideswipe/issues?q=author%3Ajadidian "Bug reports") [🤔](#ideas-jadidian "Ideas, Planning, & Feedback") |
| [<img src="https://avatars3.githubusercontent.com/u/3743054?v=4" width="100px;"/><br /><sub><b>Dan Sipple</b></sub>](https://github.com/sipplified)<br />[🐛](https://github.com/kkemple/react-native-sideswipe/issues?q=author%3Asipplified "Bug reports") [💻](https://github.com/kkemple/react-native-sideswipe/commits?author=sipplified "Code") | [<img src="https://avatars3.githubusercontent.com/u/337798?v=4" width="100px;"/><br /><sub><b>Brian B. Canin</b></sub>](http://www.briancanin.com)<br />[💻](https://github.com/kkemple/react-native-sideswipe/commits?author=cyphire "Code") [👀](#review-cyphire "Reviewed Pull Requests") | [<img src="https://avatars2.githubusercontent.com/u/1041237?v=4" width="100px;"/><br /><sub><b>Michael Sevestre</b></sub>](http://www.design2code.ca)<br />[🐛](https://github.com/kkemple/react-native-sideswipe/issues?q=author%3Amsevestre "Bug reports") [🤔](#ideas-msevestre "Ideas, Planning, & Feedback") [⚠️](https://github.com/kkemple/react-native-sideswipe/commits?author=msevestre "Tests") | [<img src="https://avatars2.githubusercontent.com/u/650099?v=4" width="100px;"/><br /><sub><b>Soheil Jadidian</b></sub>](https://github.com/jadidian)<br />[🐛](https://github.com/kkemple/react-native-sideswipe/issues?q=author%3Ajadidian "Bug reports") [🤔](#ideas-jadidian "Ideas, Planning, & Feedback") | [<img src="https://avatars2.githubusercontent.com/u/8836059?v=4" width="100px;"/><br /><sub><b>Christoph Benjamin Weber</b></sub>](https://wetainment.com)<br />[💡](#example-kriswep "Examples") |
<!-- ALL-CONTRIBUTORS-LIST:END -->

This project follows the [all-contributors](https://github.com/kentcdodds/all-contributors) specification. Contributions of any kind welcome!
Expand Down
8 changes: 8 additions & 0 deletions examples/pokedex/.babelrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{
"presets": ["babel-preset-expo"],
"env": {
"development": {
"plugins": ["transform-react-jsx-source"]
}
}
}
17 changes: 17 additions & 0 deletions examples/pokedex/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
# See https://help.github.com/ignore-files/ for more about ignoring files.

# expo
.expo/

# dependencies
/node_modules

# misc
.env.local
.env.development.local
.env.test.local
.env.production.local

npm-debug.log*
yarn-debug.log*
yarn-error.log*
1 change: 1 addition & 0 deletions examples/pokedex/.watchmanconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{}
76 changes: 76 additions & 0 deletions examples/pokedex/App.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,76 @@
import React, { Component } from 'react';
import { ActivityIndicator, Animated, Easing, View, StyleSheet } from 'react-native';
import { Font } from 'expo';
import { Provider, Client } from 'urql'; // Version can be specified in package.json
import { StackNavigator } from 'react-navigation'; // Version can be specified in package.json

import PokemonList from './PokemonList';
import PokemonDetail from './PokemonDetail';
import cache from './cache'

const client = new Client({
cache,
url: 'https://graphql-pokemon.now.sh',
});

const RouteStack = StackNavigator(
{
Home: {
screen: PokemonList,
},
Details: {
screen: PokemonDetail,
},
},
{
initialRouteName: 'Home',
headerMode: 'none',
transitionConfig: () => ({
transitionSpec: {
duration: 0,
timing: Animated.timing,
easing: Easing.step0,
},
}),
}
);

export default class App extends Component {
state = {
currentIndex: 0,
fontsLoaded: false,
};

componentDidMount = async () => {
await Font.loadAsync({
regular: require('./assets/fonts/DINNextLTPro-Regular.otf'),
bold: require('./assets/fonts/DINNextLTPro-Heavy.otf'),
black: require('./assets/fonts/DINNextLTPro-Black.otf'),
light: require('./assets/fonts/DINNextLTPro-Light.otf'),
'ultra-light': require('./assets/fonts/DINNextLTPro-UltraLight.otf'),
});

this.setState({ fontsLoaded: true });
};

render() {
return (
<Provider client={client}>
{this.state.fontsLoaded
? <RouteStack />
: <View style={styles.loader}>
<ActivityIndicator color="black" />
</View>}
</Provider>
);
}
}

const styles = StyleSheet.create({
loader: {
flex: 1,
backgroundColor: 'white',
justifyContent: 'center',
alignItems: 'center',
},
});
Loading