Make duration stats visibility conditional

This commit is contained in:
Kailash Nadh 2018-11-05 23:27:44 +05:30
parent ec7d398c21
commit f334022cd6
1 changed files with 6 additions and 7 deletions

View File

@ -208,7 +208,6 @@ class Campaigns extends React.PureComponent {
<Progress strokeColor={ color } status="active" <Progress strokeColor={ color } status="active"
type="line" percent={ this.progressPercent(record) } /> type="line" percent={ this.progressPercent(record) } />
} }
<Row><Col className="label" span={10}>Sent</Col><Col span={12}> <Row><Col className="label" span={10}>Sent</Col><Col span={12}>
{ sent >= toSend && { sent >= toSend &&
<span>{ toSend }</span> <span>{ toSend }</span>
@ -229,21 +228,21 @@ class Campaigns extends React.PureComponent {
<Row><Col className="label" span={10}>Views</Col><Col span={12}>0</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> <Row><Col className="label" span={10}>Clicks</Col><Col span={12}>0</Col></Row>
<br /> <br />
<Row><Col className="label" span={10}>Created</Col><Col span={12}>{ dayjs(record.created_at).format(cs.DateFormat) }</Col></Row> <Row><Col className="label" span={10}>Created</Col><Col span={12}>{ dayjs(record.created_at).format(cs.DateFormat) }</Col></Row>
{ startedAt && { startedAt &&
<Row><Col className="label" span={10}>Started</Col><Col span={12}>{ dayjs(startedAt).format(cs.DateFormat) }</Col></Row> <Row><Col className="label" span={10}>Started</Col><Col span={12}>{ dayjs(startedAt).format(cs.DateFormat) }</Col></Row>
} }
{ isDone && { isDone &&
<Row><Col className="label" span={10}>Ended</Col><Col span={12}> <Row><Col className="label" span={10}>Ended</Col><Col span={12}>
{ dayjs(updatedAt).format(cs.DateFormat) } { dayjs(updatedAt).format(cs.DateFormat) }
</Col></Row> </Col></Row>
} }
{ startedAt && updatedAt &&
<Row><Col className="label" span={10}>Duration</Col><Col className="duration" span={12}> <Row><Col className="label" span={10}>Duration</Col><Col className="duration" span={12}>
{ startedAt ? dayjs(updatedAt).from(dayjs(startedAt), true) : "" } { dayjs(updatedAt).from(dayjs(startedAt), true) }
</Col></Row> </Col></Row>
}
</div> </div>
) )
} }