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.
19 import React from 'react';
20 import './dashboard_card.scss';
22 var cardClass = 'dashboardCard'//classSet(this.props.class);
24 var CardHeader = React.createClass({
26 var cardClassHeader = cardClass + '_header';
27 if(this.props.className) {
28 cardClassHeader += ' ' + this.props.className + '_header';
31 <header className={cardClassHeader}>
39 CardHeader.defaultProps = {
45 var dashboardCard = React.createClass({
46 componentDidMount: function() {
49 getDefaultProps: function() {
55 var cardClassWrapper = cardClass;
56 var cardClassContent = cardClass + '_content';
57 var cardClassContentBody = cardClassContent + '-body';
60 if(this.props.className) {
61 cardClasses = this.props.className.split(' ');
62 cardClasses.map(function(c, i) {
63 cardClassWrapper += ' ' + c;
64 cardClassContent += ' ' + c + '_content';
65 cardClassContentBody += ' ' + c + '-body';
70 if (this.props.showHeader) {
71 hasHeader = <CardHeader className={this.props.className} title={this.props.title}/>;
73 if (this.props.closeCard) {
74 closeCard = this.props.closeCard;
77 <div className={cardClassWrapper} style={{display: this.props.isHidden ? 'none':'inherit'}}>
79 <i className="corner-accent top left"></i>
80 <i className="corner-accent top right"></i>
82 <div className={cardClassContent}>
83 <div className={cardClassContentBody}>
87 <i className="corner-accent bottom left"></i>
88 <i className="corner-accent bottom right"></i>
95 // class DashboardCard extends React.Component {
96 // constructor(props) {
105 export default dashboardCard;