File tree Expand file tree Collapse file tree 1 file changed +29
-21
lines changed Expand file tree Collapse file tree 1 file changed +29
-21
lines changed Original file line number Diff line number Diff line change @@ -6,35 +6,43 @@ import { BsGithub } from "react-icons/bs";
6
6
7
7
function ProjectCards ( props ) {
8
8
return (
9
- < Card className = "project-card-view" >
9
+ < Card className = "project-card-view" style = { { marginBottom : "10px" } } >
10
10
< 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" >
12
13
< Card . Title > { props . title } </ Card . Title >
13
14
< Card . Text style = { { textAlign : "justify" } } >
14
15
{ props . description }
15
16
</ Card . Text >
16
- < Button variant = "primary" href = { props . ghLink } target = "_blank" >
17
- < BsGithub />
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
+ } }
31
25
>
32
- < CgWebsite />
33
- { "Demo" }
34
- </ Button >
35
- ) }
26
+ < Button variant = "primary" href = { props . ghLink } target = "_blank" >
27
+ < BsGithub />
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 />
38
+ Demo
39
+ </ Button >
40
+ ) }
41
+ </ div >
42
+ </ div >
36
43
</ Card . Body >
37
44
</ Card >
38
45
) ;
39
46
}
47
+
40
48
export default ProjectCards ;
You can’t perform that action at this time.
0 commit comments