TopMenu.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
40
41
42
import React, { Component, Fragment } from 'react'
import TopMenuCmp from '../../../components/menus/topMenu/TopMenu.jsx'
import TopMenuMd from './resources/md/TopMenu.md'
import ReactMarkdown from 'react-markdown'
import Axios from 'axios'
import * as UrlConstants from '../../../resources/js/constants/urlConstants'
export default class TopMenu extends Component {
state = {
buttonProperty: [],
terms: null
}
componentDidMount() {
this._requestTopMenu()
}
_requestTopMenu = async () => {
await Axios.post(UrlConstants.URL_GET_MENU_NAVIGATION_LIST).then(
response => {
this.setState({ menuProperty: response.data })
}
)
await Axios({
method: 'get',
url: TopMenuMd,
responseType: 'text'
}).then(res => {
this.setState({ terms: res.data })
})
}
render() {
return (
<Fragment>
<TopMenuCmp menuProperty={this.state.menuProperty} />
<ReactMarkdown source={this.state.terms} className={'markdown-body'} />
</Fragment>
)
}
}