Comments (1)
Then something like the following should be enough to add pagination:
diff --git a/lib/components/artist/shows/past_shows.js b/lib/components/artist/shows/past_shows.js
index 6ea1fcf..8e15262 100644
--- a/lib/components/artist/shows/past_shows.js
+++ b/lib/components/artist/shows/past_shows.js
@@ -10,10 +10,14 @@ import SerifText from '../../text/serif'
import OpaqueImageView from '../../opaque_image_view'
import ShowMetadata from './show_metadata'
+const PageSize = 10;
class PastShows extends React.Component {
constructor(props) {
super(props);
+
+ this.fetchNextPage = this.fetchNextPage.bind(this);
+
this.state = {
dataSource: new ListView.DataSource({
rowHasChanged:(row1, row2) => row1 !== row2,
@@ -21,12 +25,19 @@ class PastShows extends React.Component {
};
}
+ fetchNextPage() {
+ this.props.relay.setVariables({
+ size: this.props.relay.size + PageSize,
+ });
+ }
+
render() {
return (
<ListView
dataSource={this.state.dataSource}
renderRow={this.renderShow}
renderSeparator={(sectionID, rowID) => <View key={`${sectionID}-${rowID}`} style={styles.separator} />}
+ onEndReached={this.fetchNextPage}
/>
)
}
@@ -60,10 +71,13 @@ var styles = StyleSheet.create({
});
export default Relay.createContainer(PastShows, {
+ initialVariables: {
+ size: PageSize
+ },
fragments: {
artist: () => Relay.QL`
fragment on Artist {
- partner_shows(status: "closed") {
+ partner_shows(status: "closed", size: $size) {
meta_image {
cropped(width: 75, height: 75) {
url
from emission.
Related Issues (20)
- Relay fragment not spreading
- Deployments don't work HOT 11
- Remove -u from `yarn test:ci` command
- Seeing a lot of errors due to shadows
- Recurring query cache error screen
- [RFC] Add react-native-svg HOT 11
- Action Required: Fix Renovate Configuration
- Update Dependencies (Renovate Bot)
- Logo proposal fo emission HOT 1
- [RFC] Add INTUAnimationEngine HOT 5
- [RFC] New dependency: grapheme-splitter HOT 1
- [RFC] Change "Skip New Tests" to #skip_new_tests
- Highest Bid orange looks really light HOT 3
- [RFC] Remove `yarn clean-example` from `yarns start`
- [RFC] Add husky and lint-staged HOT 2
- Add tests for Button component states
- Add event emitter for `view(Will/Did)Appear` events HOT 1
- [RFC] Change `yarn test` to run all types of checks that CI would also run HOT 11
- [Relay] Remove unused imports HOT 1
- [Dev] Deployment doesn't work because of our custom RN source code changes HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from emission.