4 * Copyright 2016 RIFT.IO Inc
6 * Licensed under the Apache License, Version 2.0 (the "License");
7 * you may not use this file except in compliance with the License.
8 * You may obtain a copy of the License at
10 * http://www.apache.org/licenses/LICENSE-2.0
12 * Unless required by applicable law or agreed to in writing, software
13 * distributed under the License is distributed on an "AS IS" BASIS,
14 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15 * See the License for the specific language governing permissions and
16 * limitations under the License.
21 import React
from 'react';
22 import ClassNames
from 'classnames'
23 import PureRenderMixin
from 'react-addons-pure-render-mixin'
24 import CatalogPanelTrayActions
from '../actions/CatalogPanelTrayActions'
26 import '../styles/CatalogPanelTray.scss'
28 const CatalogPanelTray
= React
.createClass({
29 mixins
: [PureRenderMixin
],
38 preventResizeCursor(e
) {
40 document
.body
.style
.cursor
= '';
42 componentWillMount() {
46 componentDidUpdate() {
48 componentWillUnmount() {
51 this.setState({isDragging
: true});
54 this.setState({isDragging
: false});
57 const classNames
= ClassNames('CatalogPanelTray', {
58 '-close': !this.props
.show
,
59 '-is-dragging': this.state
.isDragging
62 <div className
={classNames
} onMouseMove
={this.preventResizeCursor
} onDragOver
={this.onDragOver
} onDragLeave
={this.onDragLeave
}>
63 <h1 data
-open
-close
-icon
={this.props
.show
? 'open' : 'closed'} onClick
={CatalogPanelTrayActions
.toggleOpenClose
}>Catalog Package Manager
</h1
>
64 <div className
="tray-body">
72 export default CatalogPanelTray
;