material icons for core types

note that this switch logic should probably be moved outside into some sort of config file
This commit is contained in:
Lachlan Kermode
2018-12-14 13:15:27 +00:00
parent 51bff41916
commit de88334386

View File

@@ -5,13 +5,34 @@ import copy from '../../js/data/copy.json'
const CardSource = ({ source, language, isLoading, error }) => {
function renderIconText(type) {
switch(type) {
case 'Eyewitness Testimony':
return 'visibility'
case 'Government Data':
return 'public'
case 'Satellite Imagery':
return 'satellite'
case 'Second-Hand Testimony':
return 'visibility_off'
case 'Video':
return 'videocam'
case 'Photo':
return 'photo'
default:
return 'help'
}
}
return (
<div className="card-source">
{isLoading
? <Spinner/>
: (
<div className="source-row">
<i className="material-icons md-36 source-icon">photo</i>
<i className="material-icons source-icon">
{renderIconText(source.type)}
</i>
<p>{source.id}</p>
</div>
)}