mirror of
https://gitlab.com/MrFry/qmining-page
synced 2025-04-01 20:23:44 +02:00
major tidy
This commit is contained in:
parent
67b1fa2d37
commit
c19f24de87
24 changed files with 339 additions and 17 deletions
49
src/pages/manual.js
Normal file
49
src/pages/manual.js
Normal file
|
@ -0,0 +1,49 @@
|
|||
import React, { PureComponent } from 'react'
|
||||
import fetch from 'unfetch'
|
||||
|
||||
import LoadingIndicator from '../components/LoadingIndicator'
|
||||
|
||||
import constants from '../constants.json'
|
||||
|
||||
class Manual extends PureComponent {
|
||||
constructor (props) {
|
||||
super(props)
|
||||
|
||||
this.state = {
|
||||
loaded: false
|
||||
}
|
||||
|
||||
console.info('Fetching manual')
|
||||
fetch(`${constants.serverUrl}manual`) // eslint-disable-line
|
||||
.then((resp) => {
|
||||
return resp.text()
|
||||
})
|
||||
.then((data) => {
|
||||
this.manual = {
|
||||
__html: data
|
||||
}
|
||||
|
||||
this.setState({
|
||||
loaded: true
|
||||
})
|
||||
})
|
||||
}
|
||||
|
||||
render () {
|
||||
const { loaded } = this.state
|
||||
|
||||
if (loaded) {
|
||||
return (
|
||||
<div>
|
||||
<div dangerouslySetInnerHTML={this.manual} />
|
||||
</div>
|
||||
)
|
||||
} else {
|
||||
return (
|
||||
<LoadingIndicator />
|
||||
)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
export default Manual
|
Loading…
Add table
Add a link
Reference in a new issue