Additional card cleanup

This commit is contained in:
Franc Camps-Febrer
2018-11-27 12:44:40 -05:00
parent b658356448
commit 20051db90a
20 changed files with 347 additions and 191 deletions

View File

@@ -0,0 +1,30 @@
import React from 'react';
import copy from '../../js/data/copy.json';
import {isNotNullNorUndefined} from '../../js/data/utilities';
const CardTimestamp = ({ makeTimelabel, language, timestamp }) => {
const daytime_lang = copy[language].cardstack.timestamp;
const estimated_lang = copy[language].cardstack.estimated;
const unknown_lang = copy[language].cardstack.unknown_time;
if (isNotNullNorUndefined(timestamp)) {
const timelabel = makeTimelabel(timestamp);
return (
<div className="event-card-section timestamp">
<h4>{daytime_lang}</h4>
{timelabel}
</div>
);
} else {
return (
<div className="event-card-section timestamp">
<h4>{daytime_lang}</h4>
{unknown_lang}
</div>
);
}
}
export default CardTimestamp;