Skip to content

Commit 3c2c12d

Browse files
author
Peter Brendel
committed
Added Cards style
1 parent fd3be33 commit 3c2c12d

File tree

2 files changed

+54
-0
lines changed

2 files changed

+54
-0
lines changed
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
.Flex-card {
2+
margin-left:1.25%;
3+
margin-right:1.25%;
4+
flex: 1;
5+
min-width: 40%;
6+
max-width: 500px;
7+
display: flex;
8+
flex-wrap: wrap;
9+
}
10+
11+
.Flex-card p {
12+
color: orange;
13+
flex: 1;
14+
}
15+
16+
.Tag {
17+
margin-right: 5px;
18+
}
Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
import React from 'react';
2+
import Card from 'react-bootstrap/Card';
3+
import Badge from 'react-bootstrap/Badge';
4+
import './Card.css';
5+
6+
export default (props) => {
7+
8+
const renderTag = (tag, i) => {
9+
return (
10+
<Badge
11+
className="Tag"
12+
pill
13+
variant={tag.variant}
14+
index={i}>
15+
{tag.text}
16+
</Badge>
17+
);
18+
};
19+
20+
return (
21+
<>
22+
<Card className="Flex-card" bg="light">
23+
<Card.Body>
24+
<Card.Title>{props.repository}</Card.Title>
25+
<Card.Subtitle className="mb-2 text-muted">{props.author}</Card.Subtitle>
26+
<Card.Text className="Content">
27+
{props.readme}
28+
</Card.Text>
29+
<div>
30+
{props.tags.map((tag, i) => renderTag(tag, i))}
31+
</div>
32+
</Card.Body>
33+
</Card>
34+
</>
35+
);
36+
}

0 commit comments

Comments
 (0)