add Card component

This commit is contained in:
frab1t 2019-05-04 21:37:06 +02:00
parent ab7d88ca1f
commit 6b9468e75c
1 changed files with 47 additions and 0 deletions

47
src/components/Card.js Normal file
View File

@ -0,0 +1,47 @@
import React, { Component } from 'react';
import {
Card as CardBootstrap,
CardTitle,
CardText,
CardBody
} from 'reactstrap';
class Card extends Component {
constructor(props) {
super(props);
this.state = {};
}
render() {
let textAlign = "";
if (this.props.align) {
textAlign = `text-${this.props.align}`;
}
return (
<div>
<CardBootstrap className={`${textAlign} card-cust shadow-sm p-3 mb-5 bg-white rounded`} >
<CardBody>
<CardTitle>
<h4>{this.props.title}</h4>
</CardTitle>
<CardText>
{this.props.message}
</CardText>
<div>
{this.props.body}
</div>
<div>
{this.props.footer}
</div>
</CardBody>
</CardBootstrap>
</div>
);
}
}
export default Card;