mirror of
https://github.com/bellingcat/ukraine-timemap.git
synced 2026-06-11 21:08:36 +03:00
lint additional files
This commit is contained in:
@@ -3,11 +3,10 @@ import PropTypes from 'prop-types'
|
||||
import Img from 'react-image'
|
||||
|
||||
import Spinner from '../Spinner'
|
||||
import copy from '../../../js/data/copy.json'
|
||||
|
||||
const CardSource = ({ source, isLoading, onClickHandler }) => {
|
||||
function renderIconText(type) {
|
||||
switch(type) {
|
||||
function renderIconText (type) {
|
||||
switch (type) {
|
||||
case 'Eyewitness Testimony':
|
||||
return 'visibility'
|
||||
case 'Government Data':
|
||||
@@ -29,7 +28,7 @@ const CardSource = ({ source, isLoading, onClickHandler }) => {
|
||||
|
||||
if (!source) {
|
||||
return (
|
||||
<div className="card-source">
|
||||
<div className='card-source'>
|
||||
<div>Error: this source was not found</div>
|
||||
</div>
|
||||
)
|
||||
@@ -45,30 +44,30 @@ const CardSource = ({ source, isLoading, onClickHandler }) => {
|
||||
}
|
||||
|
||||
const fallbackIcon = (
|
||||
<i className="material-icons source-icon">
|
||||
<i className='material-icons source-icon'>
|
||||
{renderIconText(source.type)}
|
||||
</i>
|
||||
)
|
||||
|
||||
return (
|
||||
<div className="card-source">
|
||||
<div className='card-source'>
|
||||
{isLoading
|
||||
? <Spinner/>
|
||||
: (
|
||||
<div className="source-row" onClick={() => onClickHandler(source)}>
|
||||
{!!thumbnail ? (
|
||||
<Img
|
||||
className="source-icon"
|
||||
src={thumbnail}
|
||||
loader={<Spinner small />}
|
||||
unloader={fallbackIcon}
|
||||
width={30}
|
||||
height={30}
|
||||
/>
|
||||
) : fallbackIcon}
|
||||
<p>{source.id}</p>
|
||||
</div>
|
||||
)}
|
||||
? <Spinner />
|
||||
: (
|
||||
<div className='source-row' onClick={() => onClickHandler(source)}>
|
||||
{thumbnail ? (
|
||||
<Img
|
||||
className='source-icon'
|
||||
src={thumbnail}
|
||||
loader={<Spinner small />}
|
||||
unloader={fallbackIcon}
|
||||
width={30}
|
||||
height={30}
|
||||
/>
|
||||
) : fallbackIcon}
|
||||
<p>{source.id}</p>
|
||||
</div>
|
||||
)}
|
||||
</div>
|
||||
)
|
||||
}
|
||||
@@ -79,7 +78,7 @@ CardSource.propTypes = {
|
||||
type: PropTypes.string
|
||||
}),
|
||||
isLoading: PropTypes.bool,
|
||||
onClickHandler: PropTypes.func.isRequired,
|
||||
onClickHandler: PropTypes.func.isRequired
|
||||
}
|
||||
|
||||
export default CardSource
|
||||
|
||||
Reference in New Issue
Block a user