ButtonIcon.jsx
1.03 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
import React, { Component, Fragment } from 'react'
import ButtonIconCmp from '../../../components/button/icon/ButtonIcon'
import ButtonIconMd from './resources/md/ButtonIcon.md'
import ReactMarkdown from 'react-markdown'
import Axios from 'axios'
import * as UrlConstants from '../../../resources/js/constants/urlConstants'
export default class ButtonIcon extends Component {
state = {
buttonProperty: [],
terms: null
}
componentDidMount() {
this._requestButtonIcon()
}
_requestButtonIcon = async () => {
await Axios.post(UrlConstants.URL_GET_BUTTON_ICON).then(response => {
this.setState({ buttonProperty: response.data })
})
await Axios({
method: 'get',
url: ButtonIconMd,
responseType: 'text'
}).then(res => {
this.setState({ terms: res.data })
})
}
render() {
return (
<Fragment>
<ButtonIconCmp buttonProperty={this.state.buttonProperty} />
<ReactMarkdown source={this.state.terms} className={'markdown-body'} />
</Fragment>
)
}
}