mirror of
https://github.com/status-im/react-native.git
synced 2025-01-14 19:44:13 +00:00
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
This commit is contained in:
parent
bc56eb1439
commit
129d1548a8
@ -14,14 +14,16 @@ var HeaderLinks = require('HeaderLinks');
|
|||||||
|
|
||||||
var Site = React.createClass({
|
var Site = React.createClass({
|
||||||
render: function() {
|
render: function() {
|
||||||
|
var title = this.props.title ? this.props.title + ' – ' : '';
|
||||||
|
title += 'React Native | A framework for building native apps using React';
|
||||||
return (
|
return (
|
||||||
<html>
|
<html>
|
||||||
<head>
|
<head>
|
||||||
<meta charSet="utf-8" />
|
<meta charSet="utf-8" />
|
||||||
<meta httpEquiv="X-UA-Compatible" content="IE=edge,chrome=1" />
|
<meta httpEquiv="X-UA-Compatible" content="IE=edge,chrome=1" />
|
||||||
<title>React Native | A framework for building native apps using React</title>
|
<title>{title}</title>
|
||||||
<meta name="viewport" content="width=device-width" />
|
<meta name="viewport" content="width=device-width" />
|
||||||
<meta property="og:title" content="React Native | A framework for building native apps using React" />
|
<meta property="og:title" content={title} />
|
||||||
<meta property="og:type" content="website" />
|
<meta property="og:type" content="website" />
|
||||||
<meta property="og:url" content="http://facebook.github.io/react-native/index.html" />
|
<meta property="og:url" content="http://facebook.github.io/react-native/index.html" />
|
||||||
<meta property="og:image" content="http://facebook.github.io/react-native/img/opengraph.png?2" />
|
<meta property="og:image" content="http://facebook.github.io/react-native/img/opengraph.png?2" />
|
||||||
|
@ -338,7 +338,7 @@ var Autodocs = React.createClass({
|
|||||||
<APIDoc content={docs} />;
|
<APIDoc content={docs} />;
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<Site section="docs">
|
<Site section="docs" title={metadata.title}>
|
||||||
<section className="content wrap documentationContent">
|
<section className="content wrap documentationContent">
|
||||||
<DocsSidebar metadata={metadata} />
|
<DocsSidebar metadata={metadata} />
|
||||||
<div className="inner-content">
|
<div className="inner-content">
|
||||||
|
@ -18,7 +18,7 @@ var DocsLayout = React.createClass({
|
|||||||
var metadata = this.props.metadata;
|
var metadata = this.props.metadata;
|
||||||
var content = this.props.children;
|
var content = this.props.children;
|
||||||
return (
|
return (
|
||||||
<Site section="docs">
|
<Site section="docs" title={metadata.title}>
|
||||||
<section className="content wrap documentationContent">
|
<section className="content wrap documentationContent">
|
||||||
<DocsSidebar metadata={metadata} />
|
<DocsSidebar metadata={metadata} />
|
||||||
<div className="inner-content">
|
<div className="inner-content">
|
||||||
|
@ -18,7 +18,7 @@ var support = React.createClass({
|
|||||||
var metadata = this.props.metadata;
|
var metadata = this.props.metadata;
|
||||||
var content = this.props.children;
|
var content = this.props.children;
|
||||||
return (
|
return (
|
||||||
<Site section={metadata.section}>
|
<Site section={metadata.section} title={metadata.title}>
|
||||||
<section className="content wrap documentationContent nosidebar">
|
<section className="content wrap documentationContent nosidebar">
|
||||||
<div className="inner-content">
|
<div className="inner-content">
|
||||||
<Marked>{content}</Marked>
|
<Marked>{content}</Marked>
|
||||||
|
2
website/src/react-native/support.js
vendored
2
website/src/react-native/support.js
vendored
@ -15,7 +15,7 @@ var H2 = require('H2');
|
|||||||
var support = React.createClass({
|
var support = React.createClass({
|
||||||
render: function() {
|
render: function() {
|
||||||
return (
|
return (
|
||||||
<Site section="support">
|
<Site section="support" title="Support">
|
||||||
|
|
||||||
<section className="content wrap documentationContent nosidebar">
|
<section className="content wrap documentationContent nosidebar">
|
||||||
<div className="inner-content">
|
<div className="inner-content">
|
||||||
|
Loading…
x
Reference in New Issue
Block a user