From 464273374306bcbe81400e782d1fe1c5c7129a07 Mon Sep 17 00:00:00 2001 From: manonthemat Date: Mon, 7 Mar 2016 06:02:33 -0800 Subject: [PATCH] Add app to showcase with source link Summary:3 small changes Added a published android app to the showcase. Modified the rendering of the apps. When there's a _source_ property on the app object, the link will show up as shown in this screenshot. ![screen shot 2016-02-04 at 9 13 31 am](https://cloud.githubusercontent.com/assets/5065940/12823220/a79bafcc-cb1f-11e5-8cf5-03b03ecadc45.png) Also, external links have the _blank target and not just blank (without the underscore), so a new tab/window will always be opened. Closes https://github.com/facebook/react-native/pull/5761 Differential Revision: D2943464 fb-gh-sync-id: 18c88a90fc7c477730a78442ab0ab45733676dea shipit-source-id: 18c88a90fc7c477730a78442ab0ab45733676dea --- website/src/react-native/showcase.js | 33 +++++++++++++++++++++------- 1 file changed, 25 insertions(+), 8 deletions(-) diff --git a/website/src/react-native/showcase.js b/website/src/react-native/showcase.js index 1a5b48384..764b41759 100644 --- a/website/src/react-native/showcase.js +++ b/website/src/react-native/showcase.js @@ -456,6 +456,13 @@ var apps = [ icon: 'https://lh3.googleusercontent.com/5N0WYat5WuFbhi5yR2ccdbqmiZ0wbTtKRG9GhT3YK7Z-qRvmykZyAgk0HNElOxD2JOPr=w300-rw', link: 'https://play.google.com/store/apps/details?id=com.rhyble.nalathekerala', author: 'Rhyble', + }, + { + name: 'No Fluff: Hiragana', + icon: 'https://lh3.googleusercontent.com/kStXwjpbPsu27E1nIEU1gfG0I8j9t5bAR_20OMhGZvu0j2vab3EbBV7O_KNZChjflZ_O', + link: 'https://play.google.com/store/apps/details?id=com.hiragana', + author: 'Matthias Sieber', + source: 'https://github.com/manonthemat/no-fluff-hiragana' }, { name: 'Night Light', @@ -683,6 +690,7 @@ var AppList = React.createClass({ {app.linkAppStore && app.linkPlayStore ? this._renderLinks(app) : null}

By {app.author}

{this._renderBlogPosts(app)} + {this._renderSourceLink(app)} {this._renderVideos(app)} ); @@ -693,7 +701,7 @@ var AppList = React.createClass({ return (
- + {inner}
@@ -707,7 +715,7 @@ var AppList = React.createClass({ if (app.blogs.length === 1) { return ( -

Blog post

+

Blog post

); } else if (app.blogs.length > 1) { return ( @@ -718,12 +726,22 @@ var AppList = React.createClass({ _renderBlogPost: function(url, i) { return ( - + {i + 1}  ); }, + _renderSourceLink: function(app) { + if (!app.source) { + return; + } + + return ( +

Source

+ ); + }, + _renderVideos: function(app) { if (!app.videos) { return; @@ -731,7 +749,7 @@ var AppList = React.createClass({ if (app.videos.length === 1) { return ( -

Video

+

Video

); } else if (app.videos.length > 1) { return ( @@ -742,7 +760,7 @@ var AppList = React.createClass({ _renderVideo: function(url, i) { return ( - + {i + 1}  ); @@ -751,9 +769,8 @@ var AppList = React.createClass({ _renderLinks: function(app) { return (

- iOS - {" - "} - Android + iOS - + Android

); },