diff --git a/src/components/presentational/CardSource.js b/src/components/presentational/CardSource.js index c66d685..95fdb06 100644 --- a/src/components/presentational/CardSource.js +++ b/src/components/presentational/CardSource.js @@ -6,24 +6,22 @@ import copy from '../../js/data/copy.json' const CardSource = ({ source, language, isLoading, error }) => { const source_lang = copy[language].cardstack.source - if (isLoading) { - return - } - function renderSource() { - return ( + return source.error ? ( +
{source.error}
+ ) : (

TODO: display source properly.

) } + function renderContent() { + return isLoading ? : renderSource() + } + return (

{source_lang}:

- {source.error ? ( -
{source.error}
- ) : ( - renderSource() - )} + {renderContent()}
) }