1
0
mirror of https://github.com/franjsco/tick3t synced 2024-12-28 02:11:32 +01:00

refactoring card

This commit is contained in:
frab1t 2019-05-10 14:39:30 +02:00
parent de5a2e168f
commit dc447c023e

View File

@ -15,18 +15,26 @@ class Card extends Component {
}
render() {
let textAlign = "";
let bodyAlign;
let headAlign;
if (this.props.align) {
textAlign = `text-${this.props.align}`;
bodyAlign = `text-${this.props.bodyAlign}`;
}
if (this.props.headAlign) {
headAlign = `text-${this.props.headAlign}`;
}
return (
<div>
<CardBootstrap className={`${textAlign} shadow-sm p-3 mb-5 bg-white rounded`} >
<CardBootstrap
className={`${bodyAlign} shadow-sm p-3 mb-5 bg-white rounded`}
>
<CardBody>
<CardTitle>
<h4>{this.props.title}</h4>
<h4 className={headAlign}>
{this.props.title}
</h4>
</CardTitle>
<CardText>
{this.props.subtitle}
@ -36,7 +44,6 @@ class Card extends Component {
</div>
</CardBody>
</CardBootstrap>
</div>
);
}
}