Rift.IO OSM R1 Initial Submission
[osm/UI.git] / skyquake / plugins / composer / src / src / components / DropZonePanel.js
1
2 /*
3 *
4 * Copyright 2016 RIFT.IO Inc
5 *
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
9 *
10 * http://www.apache.org/licenses/LICENSE-2.0
11 *
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.
17 *
18 */
19 /**
20 * Created by onvelocity on 11/6/15.
21 */
22 'use strict';
23
24 import React from 'react'
25 import PureRenderMixin from 'react-addons-pure-render-mixin'
26 import ClassNames from 'classnames'
27
28 import '../styles/DropZonePanel.scss'
29
30 const DropZonePanel = React.createClass({
31 mixins: [PureRenderMixin],
32 getInitialState() {
33 return {};
34 },
35 getDefaultProps() {
36 return {show: false, className: 'DropZonePanel', title: 'Drop files to upload.'};
37 },
38 componentWillMount() {
39 },
40 componentDidMount() {
41 },
42 componentDidUpdate() {
43 },
44 componentWillUnmount() {
45 },
46 render() {
47 const classNames = ClassNames(this.props.className, {'-close': !this.props.show});
48 return (
49 <div className={classNames}>
50 <div className="dz-default dz-message">
51 <span>{this.props.title}</span>
52 </div>
53 {this.props.children}
54 </div>
55 );
56 }
57 });
58
59 export default DropZonePanel;