/** * Copyright (c) 2015-present, Facebook, Inc. * All rights reserved. * * This source code is licensed under the BSD-style license found in the * LICENSE file in the root directory of this source tree. An additional grant * of patent rights can be found in the PATENTS file in the same directory. * * @providesModule BlogPageLayout */ 'use strict'; var React = require('React'); var Site = require('Site'); var Hero = require('Hero'); var MetadataBlog = require('MetadataBlog'); var BlogPost = require('BlogPost'); var BlogPostExcerpt = require('BlogPostExcerpt'); var BlogPageLayout = React.createClass({ getPageURL: function(page) { var url = '/react-native/blog/'; if (page > 0) { url += 'page' + (page + 1) + '/'; } return url + '#content'; }, render: function() { var perPage = this.props.metadata.perPage; var page = this.props.metadata.page; return (
{MetadataBlog.files .slice(page * perPage, (page + 1) * perPage) .map((post) => { return ( ) }) }
{page > 0 && ← Newer posts} {MetadataBlog.files.length > (page + 1) * perPage && Older posts →}
); } }); module.exports = BlogPageLayout;