Website tweaks

This commit is contained in:
Christopher Chedeau 2015-03-21 10:59:41 -07:00
parent edb9322fe4
commit 4f8a86e8d7
6 changed files with 15 additions and 13 deletions

View File

@ -4,7 +4,7 @@ title: Getting Started
layout: docs layout: docs
category: Quick Start category: Quick Start
permalink: docs/getting-started.html permalink: docs/getting-started.html
next: network next: pixels
--- ---
Our first React Native implementation is `ReactKit`, targeting iOS. We are also Our first React Native implementation is `ReactKit`, targeting iOS. We are also

View File

@ -2,9 +2,9 @@
id: network id: network
title: Network title: Network
layout: docs layout: docs
category: Guides category: Polyfills
permalink: docs/network.html permalink: docs/network.html
next: pixels next: timers
--- ---
One of React Native goal is to be a playground where we can experiment with different architectures and crazy ideas. Since browsers are not flexible enough, we had no choice but to reimplement the entire stack. In the places that we did not intend to change, we tried to be as faithful as possible to the browser APIs. The networking stack is a great example. One of React Native goal is to be a playground where we can experiment with different architectures and crazy ideas. Since browsers are not flexible enough, we had no choice but to reimplement the entire stack. In the places that we did not intend to change, we tried to be as faithful as possible to the browser APIs. The networking stack is a great example.

View File

@ -4,7 +4,7 @@ title: Style
layout: docs layout: docs
category: Guides category: Guides
permalink: docs/style.html permalink: docs/style.html
next: timers next: activityindicatorios
--- ---
## Declaring Styles ## Declaring Styles

View File

@ -2,9 +2,8 @@
id: timers id: timers
title: Timers title: Timers
layout: docs layout: docs
category: Guides category: Polyfills
permalink: docs/timers.html permalink: docs/timers.html
next: activityindicatorios
--- ---
Timers are an important part of an application and React Native implements the [browser timers](https://developer.mozilla.org/en-US/Add-ons/Code_snippets/Timers). Timers are an important part of an application and React Native implements the [browser timers](https://developer.mozilla.org/en-US/Add-ons/Code_snippets/Timers).
@ -59,7 +58,7 @@ InteractionManager.clearInteractionHandle(handle);
We found out that the primary cause of fatals in apps created with React Native was due to timers firing after a component was unmounted. To solve this recurring issue, we introduced `TimerMixin`. If you include `TimerMixin`, then you can replace your calls to `setTimeout(fn, 500)` with `this.setTimeout(fn, 500)` (just prepend `this.`) and everything will be properly cleaned up for you when the component unmounts. We found out that the primary cause of fatals in apps created with React Native was due to timers firing after a component was unmounted. To solve this recurring issue, we introduced `TimerMixin`. If you include `TimerMixin`, then you can replace your calls to `setTimeout(fn, 500)` with `this.setTimeout(fn, 500)` (just prepend `this.`) and everything will be properly cleaned up for you when the component unmounts.
```javascript ```javascript
var { TimerMixin } = React; var TimerMixin = require('react-timer-mixin');
var Component = React.createClass({ var Component = React.createClass({
mixins: [TimerMixin], mixins: [TimerMixin],

View File

@ -28,7 +28,9 @@ function componentsToMarkdown(type, json, filepath, i) {
'layout: autodocs', 'layout: autodocs',
'category: ' + type + 's', 'category: ' + type + 's',
'permalink: docs/' + slugify(componentName) + '.html', 'permalink: docs/' + slugify(componentName) + '.html',
all[i + 1] && ('next: ' + slugify(getNameFromPath(all[i + 1]))), 'next: ' + (all[i + 1] ?
slugify(getNameFromPath(all[i + 1])) :
'network'),
'---', '---',
JSON.stringify(json, null, 2), JSON.stringify(json, null, 2),
].filter(function(line) { return line; }).join('\n'); ].filter(function(line) { return line; }).join('\n');

View File

@ -345,15 +345,16 @@ h1:hover .hash-link, h2:hover .hash-link, h3:hover .hash-link, h4:hover .hash-li
} }
.nav-docs { .nav-docs {
color: #2d2d2d;
font-size: 14px; font-size: 14px;
float: left; float: left;
width: 210px; width: 210px;
margin-top: 5px;
} }
.nav-docs ul { .nav-docs ul {
list-style: none; list-style: none;
margin: 0; margin: 0;
margin-left: 10px;
} }
.nav-docs ul ul { .nav-docs ul ul {
@ -383,10 +384,10 @@ h1:hover .hash-link, h2:hover .hash-link, h3:hover .hash-link, h4:hover .hash-li
color: #0485A9; color: #0485A9;
} }
.nav-docs .nav-docs-section { .nav-docs h3 {
border-bottom: 1px solid #ccc; margin: 0;
border-top: 1px solid #eee; line-height: 25px;
padding: 12px 0; margin-top: 5px;
} }
.nav-docs .nav-docs-section:first-child { .nav-docs .nav-docs-section:first-child {