mirror of
https://github.com/bellingcat/ukraine-timemap.git
synced 2026-06-12 21:38:35 +03:00
significantly refactor presentational components
This commit is contained in:
30
src/components/presentational/Card/Location.js
Normal file
30
src/components/presentational/Card/Location.js
Normal file
@@ -0,0 +1,30 @@
|
||||
import React from 'react';
|
||||
|
||||
import copy from '../../../js/data/copy.json';
|
||||
import { isNotNullNorUndefined } from '../../../js/utilities';
|
||||
|
||||
const CardLocation = ({ language, location }) => {
|
||||
|
||||
if (isNotNullNorUndefined(location)) {
|
||||
return (
|
||||
<div className="card-cell location">
|
||||
<p>
|
||||
<i className="material-icons left">location_on</i>
|
||||
{location}
|
||||
</p>
|
||||
</div>
|
||||
);
|
||||
} else {
|
||||
const unknown = copy[language].cardstack.unknown_location;
|
||||
return (
|
||||
<div className="card-cell location">
|
||||
<p>
|
||||
<i className="material-icons left">location_on</i>
|
||||
{unknown}
|
||||
</p>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
export default CardLocation;
|
||||
Reference in New Issue
Block a user