mirror of
https://github.com/franjsco/tick3t
synced 2024-12-28 18:29:56 +01:00
refactoring card
This commit is contained in:
parent
de5a2e168f
commit
dc447c023e
@ -15,18 +15,26 @@ class Card extends Component {
|
|||||||
}
|
}
|
||||||
|
|
||||||
render() {
|
render() {
|
||||||
let textAlign = "";
|
let bodyAlign;
|
||||||
|
let headAlign;
|
||||||
|
|
||||||
if (this.props.align) {
|
if (this.props.align) {
|
||||||
textAlign = `text-${this.props.align}`;
|
bodyAlign = `text-${this.props.bodyAlign}`;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (this.props.headAlign) {
|
||||||
|
headAlign = `text-${this.props.headAlign}`;
|
||||||
|
}
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div>
|
<CardBootstrap
|
||||||
<CardBootstrap className={`${textAlign} shadow-sm p-3 mb-5 bg-white rounded`} >
|
className={`${bodyAlign} shadow-sm p-3 mb-5 bg-white rounded`}
|
||||||
|
>
|
||||||
<CardBody>
|
<CardBody>
|
||||||
<CardTitle>
|
<CardTitle>
|
||||||
<h4>{this.props.title}</h4>
|
<h4 className={headAlign}>
|
||||||
|
{this.props.title}
|
||||||
|
</h4>
|
||||||
</CardTitle>
|
</CardTitle>
|
||||||
<CardText>
|
<CardText>
|
||||||
{this.props.subtitle}
|
{this.props.subtitle}
|
||||||
@ -36,7 +44,6 @@ class Card extends Component {
|
|||||||
</div>
|
</div>
|
||||||
</CardBody>
|
</CardBody>
|
||||||
</CardBootstrap>
|
</CardBootstrap>
|
||||||
</div>
|
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user