Skip to content

Commit

Permalink
Make duration stats visibility conditional
Browse files Browse the repository at this point in the history
  • Loading branch information
knadh committed Nov 5, 2018
1 parent ec7d398 commit f334022
Showing 1 changed file with 6 additions and 7 deletions.
13 changes: 6 additions & 7 deletions frontend/my/src/Campaigns.js
Expand Up @@ -208,7 +208,6 @@ class Campaigns extends React.PureComponent {
<Progress strokeColor={ color } status="active"
type="line" percent={ this.progressPercent(record) } />
}

<Row><Col className="label" span={10}>Sent</Col><Col span={12}>
{ sent >= toSend &&
<span>{ toSend }</span>
Expand All @@ -225,25 +224,25 @@ class Campaigns extends React.PureComponent {
{ rate > 0 &&
<Row><Col className="label" span={10}>Rate</Col><Col span={12}>{ Math.round(rate, 2) } / min</Col></Row>
}

<Row><Col className="label" span={10}>Views</Col><Col span={12}>0</Col></Row>
<Row><Col className="label" span={10}>Clicks</Col><Col span={12}>0</Col></Row>
<br />

<Row><Col className="label" span={10}>Created</Col><Col span={12}>{ dayjs(record.created_at).format(cs.DateFormat) }</Col></Row>

{ startedAt &&
<Row><Col className="label" span={10}>Started</Col><Col span={12}>{ dayjs(startedAt).format(cs.DateFormat) }</Col></Row>
}

{ isDone &&
<Row><Col className="label" span={10}>Ended</Col><Col span={12}>
{ dayjs(updatedAt).format(cs.DateFormat) }
</Col></Row>
}
<Row><Col className="label" span={10}>Duration</Col><Col className="duration" span={12}>
{ startedAt ? dayjs(updatedAt).from(dayjs(startedAt), true) : "" }
</Col></Row>
{ startedAt && updatedAt &&
<Row><Col className="label" span={10}>Duration</Col><Col className="duration" span={12}>
{ dayjs(updatedAt).from(dayjs(startedAt), true) }
</Col></Row>
}
</div>
)
}
Expand Down

0 comments on commit f334022

Please sign in to comment.