Skip to content

Commit 137a37b

Browse files
author
MICHAEL JACKSON
committed
Prettify website
1 parent dc199db commit 137a37b

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

82 files changed

+2974
-2849
lines changed

website/modules/LoadServiceWorker.js

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,11 @@
11
/*eslint no-console: 0*/
2-
if (process.env.NODE_ENV === 'production') {
3-
if ('serviceWorker' in navigator) {
4-
navigator.serviceWorker.register('service-worker.js').catch((ex) => {
5-
console.warn(ex)
6-
console.warn('(This warning can be safely ignored outside of the production build.)')
7-
})
2+
if (process.env.NODE_ENV === "production") {
3+
if ("serviceWorker" in navigator) {
4+
navigator.serviceWorker.register("service-worker.js").catch(ex => {
5+
console.warn(ex);
6+
console.warn(
7+
"(This warning can be safely ignored outside of the production build.)"
8+
);
9+
});
810
}
911
}

website/modules/ReactRouterDOMShim.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import React from 'react'
1+
import React from "react";
22

33
export {
44
HashRouter,
@@ -13,10 +13,10 @@ export {
1313
Switch,
1414
matchPath,
1515
withRouter
16-
} from '../../packages/react-router-dom'
16+
} from "../../packages/react-router-dom";
1717

1818
// Need to shim <BrowserRouter> so people can copy/paste
1919
// examples into create-react-app but our docs site already
2020
// has a <BrowserRouter> rendered up top!
2121
export const BrowserRouter = ({ children }) =>
22-
children ? React.Children.only(children) : null
22+
children ? React.Children.only(children) : null;

website/modules/Theme.js

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
1-
export const RED = 'hsl(0, 78%, 60%)'
2-
export const DARK_GRAY = 'hsl(0, 0%, 14.5%)'
3-
export const LIGHT_GRAY = 'hsl(0, 0%, 32%)'
4-
export const BRIGHT_GRAY = 'hsl(0, 0%, 78%)'
5-
export const SMALL_SCREEN = '(max-width: 600px)'
6-
1+
export const RED = "hsl(0, 78%, 60%)";
2+
export const DARK_GRAY = "hsl(0, 0%, 14.5%)";
3+
export const LIGHT_GRAY = "hsl(0, 0%, 32%)";
4+
export const BRIGHT_GRAY = "hsl(0, 0%, 78%)";
5+
export const SMALL_SCREEN = "(max-width: 600px)";

website/modules/animated/Animated.js

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,18 +8,22 @@
88
*
99
* @flow
1010
*/
11-
'use strict'
11+
"use strict";
1212

1313
// Note(vjeux): this would be better as an interface but flow doesn't
1414
// support them yet
1515
class Animated {
1616
__attach(): void {}
1717
__detach(): void {}
1818
__getValue(): any {}
19-
__getAnimatedValue(): any { return this.__getValue() }
19+
__getAnimatedValue(): any {
20+
return this.__getValue();
21+
}
2022
__addChild(child: Animated) {}
2123
__removeChild(child: Animated) {}
22-
__getChildren(): Array<Animated> { return [] }
24+
__getChildren(): Array<Animated> {
25+
return [];
26+
}
2327
}
2428

25-
module.exports = Animated
29+
module.exports = Animated;

website/modules/animated/AnimatedAddition.js

Lines changed: 27 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -8,71 +8,71 @@
88
*
99
* @flow
1010
*/
11-
'use strict'
11+
"use strict";
1212

13-
var AnimatedWithChildren = require('./AnimatedWithChildren')
14-
var Animated = require('./Animated')
15-
var AnimatedValue = require('./AnimatedValue')
16-
var Interpolation = require('./Interpolation')
17-
var AnimatedInterpolation = require('./AnimatedInterpolation')
13+
var AnimatedWithChildren = require("./AnimatedWithChildren");
14+
var Animated = require("./Animated");
15+
var AnimatedValue = require("./AnimatedValue");
16+
var Interpolation = require("./Interpolation");
17+
var AnimatedInterpolation = require("./AnimatedInterpolation");
1818

19-
import type { InterpolationConfigType } from './Interpolation'
19+
import type { InterpolationConfigType } from "./Interpolation";
2020

2121
class AnimatedAddition extends AnimatedWithChildren {
2222
_a: Animated;
2323
_b: Animated;
2424
_aListener: number;
2525
_bListener: number;
26-
_listeners: {[key: number]: ValueListenerCallback};
26+
_listeners: { [key: number]: ValueListenerCallback };
2727

2828
constructor(a: Animated | number, b: Animated | number) {
29-
super()
30-
this._a = typeof a === 'number' ? new AnimatedValue(a) : a
31-
this._b = typeof b === 'number' ? new AnimatedValue(b) : b
32-
this._listeners = {}
29+
super();
30+
this._a = typeof a === "number" ? new AnimatedValue(a) : a;
31+
this._b = typeof b === "number" ? new AnimatedValue(b) : b;
32+
this._listeners = {};
3333
}
3434

3535
__getValue(): number {
36-
return this._a.__getValue() + this._b.__getValue()
36+
return this._a.__getValue() + this._b.__getValue();
3737
}
3838

3939
addListener(callback: ValueListenerCallback): string {
4040
if (!this._aListener && this._a.addListener) {
4141
this._aListener = this._a.addListener(() => {
4242
for (var key in this._listeners) {
43-
this._listeners[key]({value: this.__getValue()})
43+
this._listeners[key]({ value: this.__getValue() });
4444
}
45-
})
45+
});
4646
}
4747
if (!this._bListener && this._b.addListener) {
4848
this._bListener = this._b.addListener(() => {
4949
for (var key in this._listeners) {
50-
this._listeners[key]({value: this.__getValue()})
50+
this._listeners[key]({ value: this.__getValue() });
5151
}
52-
})
52+
});
5353
}
54-
var id = guid()
55-
this._listeners[id] = callback
56-
return id
54+
var id = guid();
55+
this._listeners[id] = callback;
56+
return id;
5757
}
5858

5959
removeListener(id: string): void {
60-
delete this._listeners[id]
60+
delete this._listeners[id];
6161
}
6262

6363
interpolate(config: InterpolationConfigType): AnimatedInterpolation {
64-
return new AnimatedInterpolation(this, Interpolation.create(config))
64+
return new AnimatedInterpolation(this, Interpolation.create(config));
6565
}
6666

6767
__attach(): void {
68-
this._a.__addChild(this)
69-
this._b.__addChild(this)
68+
this._a.__addChild(this);
69+
this._b.__addChild(this);
7070
}
7171

7272
__detach(): void {
73-
this._a.__removeChild(this)
74-
this._b.__removeChild(this)
73+
this._a.__removeChild(this);
74+
this._b.__removeChild(this);
7575
}
7676
}
7777

78-
module.exports = AnimatedAddition
78+
module.exports = AnimatedAddition;

website/modules/animated/AnimatedInterpolation.js

Lines changed: 32 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -8,67 +8,70 @@
88
*
99
* @flow
1010
*/
11-
'use strict'
11+
"use strict";
1212

13-
var Animated = require('./Animated')
14-
var AnimatedWithChildren = require('./AnimatedWithChildren')
15-
var invariant = require('invariant')
16-
var Interpolation = require('./Interpolation')
17-
var guid = require('./guid')
13+
var Animated = require("./Animated");
14+
var AnimatedWithChildren = require("./AnimatedWithChildren");
15+
var invariant = require("invariant");
16+
var Interpolation = require("./Interpolation");
17+
var guid = require("./guid");
1818

19-
import type { ValueListenerCallback } from './AnimatedValue'
19+
import type { ValueListenerCallback } from "./AnimatedValue";
2020

2121
class AnimatedInterpolation extends AnimatedWithChildren {
2222
_parent: Animated;
2323
_interpolation: (input: number) => number | string;
24-
_listeners: {[key: number]: ValueListenerCallback};
24+
_listeners: { [key: number]: ValueListenerCallback };
2525
_parentListener: number;
2626

27-
constructor(parent: Animated, interpolation: (input: number) => number | string) {
28-
super()
29-
this._parent = parent
30-
this._interpolation = interpolation
31-
this._listeners = {}
27+
constructor(
28+
parent: Animated,
29+
interpolation: (input: number) => number | string
30+
) {
31+
super();
32+
this._parent = parent;
33+
this._interpolation = interpolation;
34+
this._listeners = {};
3235
}
3336

3437
__getValue(): number | string {
35-
var parentValue: number = this._parent.__getValue()
38+
var parentValue: number = this._parent.__getValue();
3639
invariant(
37-
typeof parentValue === 'number',
38-
'Cannot interpolate an input which is not a number.'
39-
)
40-
return this._interpolation(parentValue)
40+
typeof parentValue === "number",
41+
"Cannot interpolate an input which is not a number."
42+
);
43+
return this._interpolation(parentValue);
4144
}
4245

4346
addListener(callback: ValueListenerCallback): string {
4447
if (!this._parentListener) {
4548
this._parentListener = this._parent.addListener(() => {
4649
for (var key in this._listeners) {
47-
this._listeners[key]({value: this.__getValue()})
50+
this._listeners[key]({ value: this.__getValue() });
4851
}
49-
})
52+
});
5053
}
51-
var id = guid()
52-
this._listeners[id] = callback
53-
return id
54+
var id = guid();
55+
this._listeners[id] = callback;
56+
return id;
5457
}
5558

5659
removeListener(id: string): void {
57-
delete this._listeners[id]
60+
delete this._listeners[id];
5861
}
5962

6063
interpolate(config: InterpolationConfigType): AnimatedInterpolation {
61-
return new AnimatedInterpolation(this, Interpolation.create(config))
64+
return new AnimatedInterpolation(this, Interpolation.create(config));
6265
}
6366

6467
__attach(): void {
65-
this._parent.__addChild(this)
68+
this._parent.__addChild(this);
6669
}
6770

6871
__detach(): void {
69-
this._parent.__removeChild(this)
70-
this._parentListener = this._parent.removeListener(this._parentListener)
72+
this._parent.__removeChild(this);
73+
this._parentListener = this._parent.removeListener(this._parentListener);
7174
}
7275
}
7376

74-
module.exports = AnimatedInterpolation
77+
module.exports = AnimatedInterpolation;

website/modules/animated/AnimatedModulo.js

Lines changed: 24 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -8,60 +8,62 @@
88
*
99
* @flow
1010
*/
11-
'use strict'
11+
"use strict";
1212

13-
var Animated = require('./Animated')
14-
var AnimatedWithChildren = require('./AnimatedWithChildren')
15-
var AnimatedInterpolation = require('./AnimatedInterpolation')
16-
var Interpolation = require('./Interpolation')
13+
var Animated = require("./Animated");
14+
var AnimatedWithChildren = require("./AnimatedWithChildren");
15+
var AnimatedInterpolation = require("./AnimatedInterpolation");
16+
var Interpolation = require("./Interpolation");
1717

18-
import type { InterpolationConfigType } from './Interpolation'
18+
import type { InterpolationConfigType } from "./Interpolation";
1919

2020
class AnimatedModulo extends AnimatedWithChildren {
2121
_a: Animated;
2222
_modulus: number; // TODO(lmr): Make modulus able to be an animated value
2323
_aListener: number;
24-
_listeners: {[key: number]: ValueListenerCallback};
24+
_listeners: { [key: number]: ValueListenerCallback };
2525

2626
constructor(a: Animated, modulus: number) {
27-
super()
28-
this._a = a
29-
this._modulus = modulus
30-
this._listeners = {}
27+
super();
28+
this._a = a;
29+
this._modulus = modulus;
30+
this._listeners = {};
3131
}
3232

3333
__getValue(): number {
34-
return (this._a.__getValue() % this._modulus + this._modulus) % this._modulus
34+
return (
35+
(this._a.__getValue() % this._modulus + this._modulus) % this._modulus
36+
);
3537
}
3638

3739
addListener(callback: ValueListenerCallback): string {
3840
if (!this._aListener) {
3941
this._aListener = this._a.addListener(() => {
4042
for (var key in this._listeners) {
41-
this._listeners[key]({value: this.__getValue()})
43+
this._listeners[key]({ value: this.__getValue() });
4244
}
43-
})
45+
});
4446
}
45-
var id = guid()
46-
this._listeners[id] = callback
47-
return id
47+
var id = guid();
48+
this._listeners[id] = callback;
49+
return id;
4850
}
4951

5052
removeListener(id: string): void {
51-
delete this._listeners[id]
53+
delete this._listeners[id];
5254
}
5355

5456
interpolate(config: InterpolationConfigType): AnimatedInterpolation {
55-
return new AnimatedInterpolation(this, Interpolation.create(config))
57+
return new AnimatedInterpolation(this, Interpolation.create(config));
5658
}
5759

5860
__attach(): void {
59-
this._a.__addChild(this)
61+
this._a.__addChild(this);
6062
}
6163

6264
__detach(): void {
63-
this._a.__removeChild(this)
65+
this._a.__removeChild(this);
6466
}
6567
}
6668

67-
module.exports = AnimatedModulo
69+
module.exports = AnimatedModulo;

0 commit comments

Comments
 (0)