-
-
Notifications
You must be signed in to change notification settings - Fork 53
/
navbarContainer.js
44 lines (41 loc) · 1.64 KB
/
navbarContainer.js
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
43
44
import React from 'react'
import Logo from '../../../../resources/components/navbar/logo/logo'
import PlusControl from '../../../../resources/components/navbar/controls/plusControl'
import PlusTeaserControl from '../../../../resources/components/navbar/controls/plusTeaserControl'
import AddTemplateControl from '../../../../resources/components/navbar/controls/addTemplateControl'
import TreeViewControl from '../../../../resources/components/navbar/controls/treeViewControl'
import UndoRedoControl from '../../../../resources/components/navbar/controls/undoRedoControl'
import SettingsButtonControl from '../../../../resources/components/navbar/controls/settingsButtonControl'
import Navbar from '../../../../resources/components/navbar/navbar'
import {getStorage} from 'vc-cake'
const workspaceStorage = getStorage('workspace')
const contentEndState = workspaceStorage.state('contentEnd')
export default class NavbarContainer extends React.Component {
constructor (props) {
super(props)
this.state = {
locked: false
}
this.updateLockedState = this.updateLockedState.bind(this)
}
componentDidMount () {
contentEndState.onChange(this.updateLockedState)
}
componentWillUnmount () {
contentEndState.ignoreChange(this.updateLockedState)
}
updateLockedState (data) {
this.setState({locked: !!data})
}
render () {
return <Navbar editor='backend'>
<Logo visibility='pinned' editor='backend' />
<PlusControl visibility='pinned' />
<AddTemplateControl />
<TreeViewControl visibility='pinned' />
<UndoRedoControl />
<PlusTeaserControl />
<SettingsButtonControl />
</Navbar>
}
}