MarketTimeline

Summary: _typescript_

Reviewed By: danielbuechele

Differential Revision: D17180745

fbshipit-source-id: 0a42d5deba70ed0dfe5cd344dd5da6d2fd572999
This commit is contained in:
Chaiwat Ekkaewnumchai
2019-09-05 02:58:16 -07:00
committed by Facebook Github Bot
parent aa48e71c08
commit 2d83de99c5

View File

@@ -45,8 +45,8 @@ const Markers = styled('div')((props: {totalTime: number}) => ({
const Point = styled(FlexRow)( const Point = styled(FlexRow)(
(props: { (props: {
positionY: number; positionY: number;
onClick: Function; onClick: Function | undefined;
number: number; number: number | undefined;
threadColor: string; threadColor: string;
selected: boolean; selected: boolean;
cut: boolean; cut: boolean;
@@ -86,10 +86,10 @@ const Point = styled(FlexRow)(
zIndex: 3, zIndex: 3,
boxShadow: props.selected boxShadow: props.selected
? `0 0 0 2px ${colors.macOSTitleBarIconSelected}` ? `0 0 0 2px ${colors.macOSTitleBarIconSelected}`
: null, : undefined,
}, },
'::after': { '::after': {
content: props.cut ? '""' : null, content: props.cut ? '""' : undefined,
position: 'absolute', position: 'absolute',
width: 11, width: 11,
top: -20, top: -20,
@@ -215,8 +215,14 @@ export default class MarkerTimeline extends Component<Props, State> {
cut={p.isCut} cut={p.isCut}
positionY={p.positionY} positionY={p.positionY}
onClick={onClick ? () => onClick(p.markerKeys) : undefined} onClick={onClick ? () => onClick(p.markerKeys) : undefined}
selected={p.markerKeys.includes(this.props.selected)} selected={
number={p.markerNames.length > 1 ? p.markerNames.length : null}> this.props.selected
? p.markerKeys.includes(this.props.selected)
: false
}
number={
p.markerNames.length > 1 ? p.markerNames.length : undefined
}>
<Time>{p.timestamp}ms</Time>{' '} <Time>{p.timestamp}ms</Time>{' '}
<Code code>{p.markerNames.join(', ')}</Code> <Code code>{p.markerNames.join(', ')}</Code>
</Point> </Point>