22
33import moment from 'moment'
44import React , { Component } from 'react'
5- import { Row , Col , Tabs , Tab , ListGroupItem , Label , Badge } from 'react-bootstrap'
5+ import { Row , Col , Tabs , Tab , ListGroupItem , Label } from 'react-bootstrap'
66import numeral from 'numeral'
77
88import { getComponentMessages , isModuleEnabled } from '../../../common/util/config'
@@ -19,14 +19,14 @@ import type {Element} from 'react'
1919import type { FeedVersion } from '../../../types'
2020
2121type Props = {
22- feedVersionIndex : number ,
22+ comparedVersion : FeedVersion ,
2323 comparedVersionIndex : number ,
24+ feedVersionIndex : number ,
2425 isochroneBand : any ,
2526 onChangeIsochroneBand : number => void ,
2627 selectTab : string => void ,
2728 tab : string ,
28- version : FeedVersion ,
29- comparedVersion : FeedVersion
29+ version : FeedVersion
3030}
3131
3232export default class FeedVersionTabs extends Component < Props > {
@@ -106,30 +106,32 @@ export default class FeedVersionTabs extends Component<Props> {
106106 < Tab eventKey = { 'feed' } title = 'Summary' >
107107 < Row >
108108 { countFields . map ( c => {
109- const summary = version . validationSummary ;
110- const diff = comparedVersion ? ( summary [ c ] - comparedVersion . validationSummary [ c ] ) : 0 ;
109+ const summary = version . validationSummary
110+ const diff = comparedVersion ? ( summary [ c ] - comparedVersion . validationSummary [ c ] ) : 0
111111
112112 return (
113- < Col xs = { 2 } className = 'text-center' key = { c } >
114- < p
115- title = { `${ summary [ c ] } ` /* do we need this? */ }
116- style = { { marginBottom : '0px' , fontSize : '200%' } } >
117- { numeral ( summary [ c ] ) . format ( '0a ' ) }
113+ < Col xs = { 2 } className = 'text-center' key = { c } >
114+ < div
115+ title = { `${ summary [ c ] } ` /* do we need this? */ }
116+ style = { { marginBottom : '0px' , fontSize : '200%' } } >
117+ { numeral ( summary [ c ] ) . format ( '0a' ) }
118+ { comparedVersion
119+ ? < sup style = { { width : 0 , display : 'inline-block' } } >
120+ < Label
121+ style = { { fontSize : '50%' , padding : '0 0.2em 0.1em' } }
122+ bsStyle = { diff > 0 ? 'success' : ( diff < 0 ? 'warning' : 'default' ) }
123+ title = { `Compared to Version ${ comparedVersionIndex } ` } >
124+ { diff === 0 ? '=' : ( ( diff > 0 ? '+' : '' ) + numeral ( diff ) . format ( '0a' ) ) }
125+ </ Label >
126+ </ sup >
127+ : null }
118128
119- { comparedVersion ?
120- < Label
121- style = { { fontSize : '40%' } }
122- bsStyle = { diff > 0 ? 'success' : ( diff < 0 ? 'warning' : 'default' ) }
123- title = { `Compared to Version ${ comparedVersionIndex } ` } >
124- { diff == 0 ? '=' : ( ( diff > 0 ? '+' : '' ) + numeral ( diff ) . format ( '0a' ) ) }
125- { /*↗+{summary[c] - comparedVersion.validationSummary[c]*/ }
126- </ Label >
127- : null }
128- </ p >
129- < p style = { { marginBottom : '0px' } } > { this . messages ( c ) } </ p >
130- </ Col >
131- ) ;
132- } ) }
129+ </ div >
130+
131+ < p style = { { marginBottom : '0px' } } > { this . messages ( c ) } </ p >
132+ </ Col >
133+ )
134+ } ) }
133135 < Col xs = { 2 } className = 'text-center' >
134136 < p
135137 title = { daysActive }
0 commit comments