From 7aec6aef4a9fd76491a0d3ee3a761f5f2ff19f78 Mon Sep 17 00:00:00 2001 From: Jordan Papaleo Date: Sun, 23 Jul 2017 09:43:19 -0700 Subject: [PATCH] resolved the broken links for all components method in page linking Summary: Fixed #12327 - Run the website locally - Navigate to: http://localhost:8079/react-native/docs/statusbar.html - Click the StatusBarAnimation and the StatusBarStyle in the Method section - The links will now go to the correct in page anchor tags instead of the getting started page The `website/layout/*.js` files could use some serious love. I would really like the opportunity to do that with the react team I run. Let me know :) Closes https://github.com/facebook/react-native/pull/14028 Differential Revision: D5478418 Pulled By: hramos fbshipit-source-id: b565847da3c280466ed088fd820b5bfe0474bba0 --- website/layout/AutodocsLayout.js | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/website/layout/AutodocsLayout.js b/website/layout/AutodocsLayout.js index 10862c826a6..395adcee453 100644 --- a/website/layout/AutodocsLayout.js +++ b/website/layout/AutodocsLayout.js @@ -339,6 +339,7 @@ var ComponentDoc = React.createClass({ examples={method.examples} returns={method.returns} namedTypes={namedTypes} + entityName={this.props.componentName} /> ); }, @@ -409,7 +410,6 @@ var ComponentDoc = React.createClass({ }); var APIDoc = React.createClass({ - renderMethod: function(method, namedTypes) { return ( ); @@ -634,6 +634,7 @@ var Method = React.createClass({ if (!foundDescription) { return null; } + return (
Parameters: @@ -651,7 +652,7 @@ var Method = React.createClass({ {param.optional ? '[' + param.name + ']' : param.name}

- {renderTypeWithLinks(param.type, this.props.apiName, this.props.namedTypes)} + {renderTypeWithLinks(param.type, this.props.entityName, this.props.namedTypes)} {param.description} @@ -816,9 +817,9 @@ var Autodocs = React.createClass({ render: function() { var metadata = this.props.metadata; var docs = JSON.parse(this.props.children); - var content = docs.type === 'component' || docs.type === 'style' ? - : - ; + var content = docs.type === 'component' || docs.type === 'style' + ? + : ; return (