diff --git a/src/components/Card.jsx b/src/components/Card.jsx index 3f4340f..94d66db 100644 --- a/src/components/Card.jsx +++ b/src/components/Card.jsx @@ -93,7 +93,7 @@ class Card extends React.Component { const source_lang = copy[this.props.language].cardstack.sources return ( -
+

{source_lang}:

{this.props.event.sources.map(source => ( { - function renderContent() { - if (isLoading) { - return - } else if (source.error) { - return ( -
{source.error}
- ) - } else { - /* source with no errors */ - return ( -
-

{source.id}

- photo -
- ) - } - } - return ( -
- {renderContent()} +
+ {isLoading + ? + : ( +
+ photo +

{source.id}

+
+ )}
) } diff --git a/src/scss/card.scss b/src/scss/card.scss index e95213b..8979937 100644 --- a/src/scss/card.scss +++ b/src/scss/card.scss @@ -45,7 +45,7 @@ .card-cell { flex: 1; - } + } h4 { min-width: 80px; @@ -57,6 +57,43 @@ flex-direction: column; } + .card-source { + margin: 0; + padding: 2px 0; + border-radius: 3px; + + .source-row { + display: flex; + flex-direction: row; + align-items: flex-start; + padding: 8px 15px; + border-left: 5px solid $darkgrey; + background: linear-gradient(to right, $darkgrey 50%, transparent 50%); + background-size: 200% 100%; + background-position: right bottom; + margin-left: -16px; + margin-right: -16px; + + &:hover { + background-color: $darkgrey; + color: white; + cursor: pointer; + .material-icons { + color: white; + } + background-position: left bottom; + transition: all 2s ease; + } + } + + .source-icon { + display: flex; + align-items: center; + font-size: 24px; + margin-right: 15px; + } + } + .card-cell { a { transition: color 0.2s;