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 6cb964a3e..2c9c0fa87 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 bd6ccfb55..66bb42702 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 4f355e5ae..12ba1ebf3 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 c921bcd6b..a4ff02c60 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 3810bf0dd..622bb9ff7 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 ( - +