defined card template

This commit is contained in:
Giulio De Pasquale 2020-12-18 14:02:21 +00:00
parent ce8d4e1ef9
commit c24cad03c8

View File

@ -1,40 +1,22 @@
import React, {Component} from 'react'; import React, {Component} from 'react';
import {Card, Col, Row} from 'react-bootstrap';
type CardProps = { type CardProps = {
title: string, title: string,
content: string, content: string,
update: Date
} }
class HCard extends Component<CardProps> { export class SidebarCard extends Component<CardProps> {
constructor(props: CardProps) { constructor(props: CardProps) {
super(props) super(props)
} }
render() { render() {
return ( return (
<Card bg="light" style={{minWidth: "15rem"}} className="mx-auto"> <div className="bg-gray-300 mt-2 mx-4 rounded p-4">
<Row className="no-gutters"> <div className="text-gray-600">{this.props.title}</div>
<Col md={7} className="border-right my-auto"> <div className="mt-1 mx-auto text-center text-3xl font-semibold">{this.props.content}</div>
<h5 className="text-center my-auto">{this.props.title}</h5> </div>
</Col> )
<Col md={5}>
<Card.Body>
<Card.Text className="text-center my-auto">
{this.props.content}
</Card.Text>
</Card.Body>
</Col>
</Row>
<Card.Text className="border-top text-center">
<small className="text-muted my-auto mx-2">Last
updated {this.props.update.toLocaleTimeString('en-GB')}</small>
</Card.Text>
</Card>);
} }
} }
export default HCard;