Skip to content

Commit 2553772

Browse files
Fix/soumyajit4419#229-Project-cards
1 parent 24d955c commit 2553772

File tree

1 file changed

+29
-21
lines changed

1 file changed

+29
-21
lines changed

src/components/Projects/ProjectCards.js

Lines changed: 29 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -6,35 +6,43 @@ import { BsGithub } from "react-icons/bs";
66

77
function ProjectCards(props) {
88
return (
9-
<Card className="project-card-view">
9+
<Card className="project-card-view" style={{ marginBottom: "10px" }}>
1010
<Card.Img variant="top" src={props.imgPath} alt="card-img" />
11-
<Card.Body>
11+
{/* Use a flex-column layout for the card body so that the buttons group can stick to the bottom */}
12+
<Card.Body className="d-flex flex-column">
1213
<Card.Title>{props.title}</Card.Title>
1314
<Card.Text style={{ textAlign: "justify" }}>
1415
{props.description}
1516
</Card.Text>
16-
<Button variant="primary" href={props.ghLink} target="_blank">
17-
<BsGithub /> &nbsp;
18-
{props.isBlog ? "Blog" : "GitHub"}
19-
</Button>
20-
{"\n"}
21-
{"\n"}
22-
23-
{/* If the component contains Demo link and if it's not a Blog then, it will render the below component */}
24-
25-
{!props.isBlog && props.demoLink && (
26-
<Button
27-
variant="primary"
28-
href={props.demoLink}
29-
target="_blank"
30-
style={{ marginLeft: "10px" }}
17+
{/* Spacer div which pushes the button container down if content above is short */}
18+
<div className="mt-auto" style={{ paddingTop: "10px" }}>
19+
<div
20+
style={{
21+
display: "flex",
22+
gap: "10px",
23+
flexWrap: "wrap"
24+
}}
3125
>
32-
<CgWebsite /> &nbsp;
33-
{"Demo"}
34-
</Button>
35-
)}
26+
<Button variant="primary" href={props.ghLink} target="_blank">
27+
<BsGithub /> &nbsp;
28+
{props.isBlog ? "Blog" : "GitHub"}
29+
</Button>
30+
{/* Render Demo button if applicable */}
31+
{!props.isBlog && props.demoLink && (
32+
<Button
33+
variant="primary"
34+
href={props.demoLink}
35+
target="_blank"
36+
>
37+
<CgWebsite /> &nbsp;
38+
Demo
39+
</Button>
40+
)}
41+
</div>
42+
</div>
3643
</Card.Body>
3744
</Card>
3845
);
3946
}
47+
4048
export default ProjectCards;

0 commit comments

Comments
 (0)