From 129d1548a8f8537ee90c17ed1e9d5d5ec35204e0 Mon Sep 17 00:00:00 2001 From: Mu-An Chiou Date: Sun, 2 Aug 2015 19:45:40 +0800 Subject: [PATCH] Add dynamic page title Currently all the pages have the same title, making it hard to tell which page is while when user has multiple tabs opened. This adds 'title' to Site so a page title can be passed in and prepended to the default title --- website/core/Site.js | 6 ++++-- website/layout/AutodocsLayout.js | 2 +- website/layout/DocsLayout.js | 2 +- website/layout/PageLayout.js | 2 +- website/src/react-native/support.js | 2 +- 5 files changed, 8 insertions(+), 6 deletions(-) diff --git a/website/core/Site.js b/website/core/Site.js index 6cb964a3eea..2c9c0fa87bd 100644 --- a/website/core/Site.js +++ b/website/core/Site.js @@ -14,14 +14,16 @@ var HeaderLinks = require('HeaderLinks'); var Site = React.createClass({ render: function() { + var title = this.props.title ? this.props.title + ' – ' : ''; + title += 'React Native | A framework for building native apps using React'; return ( - React Native | A framework for building native apps using React + {title} - + diff --git a/website/layout/AutodocsLayout.js b/website/layout/AutodocsLayout.js index bd6ccfb55aa..66bb42702cd 100644 --- a/website/layout/AutodocsLayout.js +++ b/website/layout/AutodocsLayout.js @@ -338,7 +338,7 @@ var Autodocs = React.createClass({ ; return ( - +
diff --git a/website/layout/DocsLayout.js b/website/layout/DocsLayout.js index 4f355e5aee5..12ba1ebf3a2 100644 --- a/website/layout/DocsLayout.js +++ b/website/layout/DocsLayout.js @@ -18,7 +18,7 @@ var DocsLayout = React.createClass({ var metadata = this.props.metadata; var content = this.props.children; return ( - +
diff --git a/website/layout/PageLayout.js b/website/layout/PageLayout.js index c921bcd6b35..a4ff02c6045 100644 --- a/website/layout/PageLayout.js +++ b/website/layout/PageLayout.js @@ -18,7 +18,7 @@ var support = React.createClass({ var metadata = this.props.metadata; var content = this.props.children; return ( - +
{content} diff --git a/website/src/react-native/support.js b/website/src/react-native/support.js index 3810bf0ddfd..622bb9ff7f5 100644 --- a/website/src/react-native/support.js +++ b/website/src/react-native/support.js @@ -15,7 +15,7 @@ var H2 = require('H2'); var support = React.createClass({ render: function() { return ( - +