mirror of
https://github.com/bellingcat/ukraine-timemap.git
synced 2026-06-12 05:18:34 +03:00
Additional card cleanup
This commit is contained in:
30
src/components/presentational/CardTimestamp.js
Normal file
30
src/components/presentational/CardTimestamp.js
Normal 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;
|
||||
Reference in New Issue
Block a user