| 90 | } |
| 91 | |
| 92 | renderPage() { |
| 93 | switch (this.props.location) { |
| 94 | case Pages.HOME.location: |
| 95 | return <HomePage />; |
| 96 | } |
| 97 | |
| 98 | for (let groupIndex in APIPages) { |
| 99 | const group = APIPages[groupIndex]; |
| 100 | const pageKeys = Object.keys(group.pages); |
| 101 | |
| 102 | for (let i = 0; i < pageKeys.length; i++) { |
| 103 | const key = pageKeys[i]; |
| 104 | const page = group.pages[key]; |
| 105 | |
| 106 | if (this.props.location === page.location) { |
| 107 | return <APIPage example={page} |
| 108 | html={APIDocs[key]} />; |
| 109 | } |
| 110 | } |
| 111 | } |
| 112 | |
| 113 | for (let groupIndex in ExamplePages) { |
| 114 | const group = ExamplePages[groupIndex]; |