From de88334386b21188f9b7d53a5d9ca478a0877770 Mon Sep 17 00:00:00 2001 From: Lachlan Kermode Date: Fri, 14 Dec 2018 13:15:27 +0000 Subject: [PATCH] material icons for core types note that this switch logic should probably be moved outside into some sort of config file --- src/components/presentational/CardSource.js | 23 ++++++++++++++++++++- 1 file changed, 22 insertions(+), 1 deletion(-) diff --git a/src/components/presentational/CardSource.js b/src/components/presentational/CardSource.js index 0bb3d2c..d4e6dce 100644 --- a/src/components/presentational/CardSource.js +++ b/src/components/presentational/CardSource.js @@ -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 (
{isLoading ? : (
- photo + + {renderIconText(source.type)} +

{source.id}

)}