glass-app-manager
Version:
Informatica's Glass Framework CLI for bootstrapping
37 lines (27 loc) • 769 B
JavaScript
// @flow
import React, { PureComponent } from "react";
import type { Node } from "react";
import CardBody from "./CardBody";
import CardHeader from "./CardHeader";
type Props = {
children: Node,
/**
* Additional class selectors to pass to the card.
*/
className: string,
};
export default class Card extends PureComponent<Props> {
static Body = CardBody;
static Header = CardHeader;
getClassNames = (): string => {
let base = "d-card";
if (this.props.className) {
base += " ";
base += this.props.className;
}
return base;
};
render() {
return <div className={this.getClassNames()}>{this.props.children}</div>;
}
}