//@flow import * as React from "react"; import injectSheet from "react-jss"; import classNames from "classnames"; import { Link } from "react-router-dom"; const styles = { inner: { position: "relative", pointerEvents: "none", zIndex: 1 }, innerLink: { pointerEvents: "all" }, centerImage: { marginTop: "0.8em", marginLeft: "1em !important" }, flexFullHeight: { display: "flex", flexDirection: "column", justifyContent: "space-around", alignSelf: "stretch" }, footer: { display: "flex", paddingBottom: "1rem", }, topPart: { display: "flex" }, contentRight: { marginLeft: "auto" }, contentLeft: { marginBottom: "0 !important", overflow: "hidden" } }; type Props = { title: string, description: string, avatar: React.Node, contentRight?: React.Node, footerLeft: React.Node, footerRight: React.Node, link?: string, action?: () => void, className?: string, // context props classes: any }; class CardColumn extends React.Component { createLink = () => { const { link, action } = this.props; if (link) { return ; } else if (action) { return {e.preventDefault(); action();}} href="#" />; } return null; }; render() { const { avatar, title, description, contentRight, footerLeft, footerRight, classes, className } = this.props; const link = this.createLink(); return ( <> {link}
{avatar}

{title}

{description}

{contentRight && contentRight}
{footerLeft}
{footerRight}
); } } export default injectSheet(styles)(CardColumn);