Initial commit
This commit is contained in:
40
client/src/components/ui/Card.js
Normal file
40
client/src/components/ui/Card.js
Normal file
@@ -0,0 +1,40 @@
|
||||
import React from 'react';
|
||||
import PropTypes from 'prop-types';
|
||||
|
||||
import './Card.css';
|
||||
|
||||
const Card = props => (
|
||||
<div className="card">
|
||||
{ props.title &&
|
||||
<div className="card-header with-border">
|
||||
<div className="card-inner">
|
||||
<div className="card-title">
|
||||
{props.title}
|
||||
</div>
|
||||
|
||||
{props.subtitle &&
|
||||
<div className="card-subtitle" dangerouslySetInnerHTML={{ __html: props.subtitle }} />
|
||||
}
|
||||
</div>
|
||||
|
||||
{props.refresh &&
|
||||
<div className="card-options">
|
||||
{props.refresh}
|
||||
</div>
|
||||
}
|
||||
</div>}
|
||||
<div className={props.bodyType ? props.bodyType : 'card-body'}>
|
||||
{props.children}
|
||||
</div>
|
||||
</div>
|
||||
);
|
||||
|
||||
Card.propTypes = {
|
||||
title: PropTypes.string,
|
||||
subtitle: PropTypes.string,
|
||||
bodyType: PropTypes.string,
|
||||
refresh: PropTypes.node,
|
||||
children: PropTypes.node.isRequired,
|
||||
};
|
||||
|
||||
export default Card;
|
||||
Reference in New Issue
Block a user