From c1a0a722756bc0f498a371736ef6fcc171296cd8 Mon Sep 17 00:00:00 2001 From: Christopher Chedeau Date: Sat, 8 Aug 2015 10:28:05 -0700 Subject: [PATCH] [Website] Fix a-z order in props --- website/layout/AutodocsLayout.js | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/website/layout/AutodocsLayout.js b/website/layout/AutodocsLayout.js index 8a6e471cc..604082a1e 100644 --- a/website/layout/AutodocsLayout.js +++ b/website/layout/AutodocsLayout.js @@ -144,9 +144,9 @@ var ComponentDoc = React.createClass({ this.renderCompose(name) )} {Object.keys(props) - .sort((a, b) => { - a = props[a]; - b = props[b]; + .sort((nameA, nameB) => { + var a = props[nameA]; + var b = props[nameB]; if (a.platforms && !b.platforms) { return 1; @@ -154,7 +154,13 @@ var ComponentDoc = React.createClass({ if (b.platforms && !a.platforms) { return -1; } - return a.name < b.name; + if (nameA < nameB) { + return -1; + } + if (nameA > nameB) { + return 1; + } + return 0; }) .map((name) => this.renderProp(name, props[name])