mirror of
https://github.com/bellingcat/ukraine-timemap.git
synced 2026-06-08 03:18:36 +03:00
error for bad md extensions
This commit is contained in:
@@ -12,6 +12,9 @@ class Md extends React.Component {
|
||||
fetch(this.props.path)
|
||||
.then(resp => resp.text())
|
||||
.then(text => {
|
||||
if (text.length <= 0)
|
||||
throw new Error()
|
||||
|
||||
this.setState({ md: marked(text) })
|
||||
})
|
||||
.catch(err => {
|
||||
@@ -34,7 +37,7 @@ class Md extends React.Component {
|
||||
|
||||
Md.propTypes = {
|
||||
loader: PropTypes.func,
|
||||
unloader: PropTypes.func,
|
||||
unloader: PropTypes.func.isRequired,
|
||||
path: PropTypes.string.isRequired
|
||||
}
|
||||
|
||||
|
||||
@@ -7,15 +7,21 @@ import NoSource from './presentational/NoSource'
|
||||
// TODO: move render functions into presentational components
|
||||
|
||||
function SourceOverlay ({ source, onCancel }) {
|
||||
function renderError() {
|
||||
return (
|
||||
<NoSource failedUrls={["NOT ALL SOURCES AVAILABLE IN APPLICATION YET"]} />
|
||||
)
|
||||
}
|
||||
|
||||
function renderImage(path) {
|
||||
return (
|
||||
<div className='source-image-container'>
|
||||
<Img
|
||||
className='source-image'
|
||||
src={path}
|
||||
loader={<Spinner />}
|
||||
unloader={<NoSource failedUrls={source.paths} />}
|
||||
/>
|
||||
<Img
|
||||
className='source-image'
|
||||
src={path}
|
||||
loader={<Spinner />}
|
||||
unloader={<NoSource failedUrls={source.paths} />}
|
||||
/>
|
||||
</div>
|
||||
)
|
||||
}
|
||||
@@ -45,11 +51,6 @@ function SourceOverlay ({ source, onCancel }) {
|
||||
)
|
||||
}
|
||||
|
||||
function renderError() {
|
||||
return (
|
||||
<NoSource failedUrls={["NOT ALL SOURCES AVAILABLE IN APPLICATION YET"]} />
|
||||
)
|
||||
}
|
||||
|
||||
function renderNoSupport(ext) {
|
||||
return (
|
||||
|
||||
Reference in New Issue
Block a user