From 6bef0d89cf966995e13bd348554c170eea9f3973 Mon Sep 17 00:00:00 2001 From: Eimi Okuno Date: Wed, 1 Apr 2020 16:43:53 +0900 Subject: [PATCH 1/2] Refactoring the ItemsContainer switch Status - hard to read. --- src/ItemsContainer/stories/index.stories.js | 2 +- src/TranscriptCard/index.js | 391 ++++++++++++-------- 2 files changed, 245 insertions(+), 148 deletions(-) diff --git a/src/ItemsContainer/stories/index.stories.js b/src/ItemsContainer/stories/index.stories.js index 6aaffee..1f0ff6d 100644 --- a/src/ItemsContainer/stories/index.stories.js +++ b/src/ItemsContainer/stories/index.stories.js @@ -15,7 +15,7 @@ storiesOf('ItemsContainer - Demo only (not published on NPM)', module) return ( diff --git a/src/TranscriptCard/index.js b/src/TranscriptCard/index.js index 5e38872..e052813 100644 --- a/src/TranscriptCard/index.js +++ b/src/TranscriptCard/index.js @@ -10,6 +10,7 @@ import { LinkContainer } from 'react-router-bootstrap'; import ProgressBar from '../ProgressBar'; import Spinner from 'react-bootstrap/Spinner'; import { FontAwesomeIcon } from '@fortawesome/react-fontawesome'; + import { faTrash, faCheck, @@ -18,75 +19,8 @@ import { } from '@fortawesome/free-solid-svg-icons'; const TranscriptCard = props => { - const statusSwitch = status => { - switch (status) { - case 'error': - return { - variant: 'danger', - icon: , - message: props.message, - text: 'Error', - title: props.title, - border: 'danger' - }; - case 'in-progress': - return { - variant: 'info', - text: 'In progress', - icon: ( -