Update web-starter
This commit is contained in:
@ -4,6 +4,11 @@ import { findDOMNode } from 'react-dom'
|
||||
import Window from './Window'
|
||||
|
||||
class Layout extends React.Component {
|
||||
static propTypes = {
|
||||
location: PropTypes.object,
|
||||
children: PropTypes.node
|
||||
}
|
||||
|
||||
state = {
|
||||
underlineLeft: 0,
|
||||
underlineWidth: 0,
|
||||
|
@ -5,7 +5,8 @@ class NumberTextInput extends React.Component {
|
||||
static propTypes = {
|
||||
value: PropTypes.number,
|
||||
parseNumber: PropTypes.func,
|
||||
formatNumber: PropTypes.func
|
||||
formatNumber: PropTypes.func,
|
||||
onChange: PropTypes.func
|
||||
}
|
||||
|
||||
static defaultProps = {
|
||||
|
@ -1,5 +1,4 @@
|
||||
import React, { PropTypes } from 'react'
|
||||
import { findDOMNode } from 'react-dom'
|
||||
import formatBytes from 'byte-size'
|
||||
import formatDate from 'date-fns/format'
|
||||
import parseDate from 'date-fns/parse'
|
||||
@ -21,8 +20,12 @@ const addValues = (a, b) => {
|
||||
}
|
||||
|
||||
class Stats extends React.Component {
|
||||
static propTypes = {
|
||||
stats: PropTypes.object
|
||||
}
|
||||
|
||||
static defaultProps = {
|
||||
stats: window.NPMCDN_STATS
|
||||
stats: window.npmcdnStats
|
||||
}
|
||||
|
||||
state = {
|
||||
@ -83,13 +86,13 @@ class Stats extends React.Component {
|
||||
})
|
||||
|
||||
topContinents.forEach(continent => {
|
||||
const name = ContinentsIndex[continent]
|
||||
const continentName = ContinentsIndex[continent]
|
||||
const { countries, requests, bandwidth } = continentData[continent]
|
||||
|
||||
if (bandwidth !== 0) {
|
||||
regionRows.push(
|
||||
<tr key={continent} className="continent-row">
|
||||
<td>{ContinentsIndex[continent]}</td>
|
||||
<td>{continentName}</td>
|
||||
<td>{formatNumber(requests)} ({formatPercent(requests / totalRequests)}%)</td>
|
||||
<td>{formatBytes(bandwidth)} ({formatPercent(bandwidth / totalBandwidth)}%)</td>
|
||||
</tr>
|
||||
|
Reference in New Issue
Block a user