Skip to content

Commit 1f31020

Browse files
authored
Add support for 'partnerLogos' to IncubatedBy component (#190)
* Add support for 'partnerLogos' to IncubatedBy component * Update Patria-bank to transparent png * Compress image * Bump package version
1 parent 17fb59b commit 1f31020

5 files changed

Lines changed: 77 additions & 7 deletions

File tree

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@code4ro/taskforce-fe-components",
3-
"version": "1.0.25",
3+
"version": "1.0.26",
44
"private": false,
55
"dependencies": {
66
"bulma": "^0.8.0",
Lines changed: 18 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,30 @@
11
import React from "react";
2+
import PropTypes from "prop-types";
23
import { Logo } from "../logo/logo";
34
import TaskforceLogo from "../../images/code4romania-color.svg";
45
import "./incubated-by.scss";
56

6-
export const IncubatedBy = () => {
7+
export const IncubatedBy = ({ partnerLogos }) => {
78
return (
89
<div className="incubated-by-wrapper">
910
<div className="incubated-by container">
10-
<p className="caption">proiect dezvoltat în programul</p>
11-
<Logo url="https://code4.ro">
12-
<TaskforceLogo width="102" />
13-
</Logo>
11+
<div className="row">
12+
<p className="caption">proiect dezvoltat în programul</p>
13+
<Logo url="https://code4.ro">
14+
<TaskforceLogo width="102" />
15+
</Logo>
16+
</div>
17+
{partnerLogos && (
18+
<div className="row">
19+
<p className="caption">cu sprijinul</p>
20+
<div className="logos">{partnerLogos}</div>
21+
</div>
22+
)}
1423
</div>
1524
</div>
1625
);
1726
};
27+
28+
IncubatedBy.propTypes = {
29+
partnerLogos: PropTypes.arrayOf(PropTypes.node)
30+
};

src/components/incubated-by/incubated-by.scss

Lines changed: 27 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,13 +13,26 @@
1313
align-items: center;
1414
min-height: 60px;
1515

16+
.row {
17+
display: flex;
18+
align-items: center;
19+
}
20+
21+
.row + .row {
22+
margin-left: 1.5rem;
23+
}
24+
1625
.caption {
1726
font-size: 14px;
1827
line-height: 21px;
1928
color: #000;
2029
margin-right: 1.5rem;
2130
}
2231

32+
.logos {
33+
display: flex;
34+
}
35+
2336
a {
2437
display: flex;
2538
}
@@ -31,6 +44,19 @@
3144

3245
@media (max-width: 768px) {
3346
.incubated-by {
34-
justify-content: space-between;
47+
flex-direction: column;
48+
49+
.row {
50+
justify-content: space-between;
51+
width: 100%;
52+
}
53+
54+
.row + .row {
55+
margin-left: 0;
56+
}
57+
58+
.caption {
59+
margin-right: 0.5rem;
60+
}
3561
}
3662
}
Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,39 @@
11
import React from "react";
22
import { IncubatedBy } from "./incubated-by";
3+
import { Logo } from "../..";
4+
import patriaBank from "../../images/patria-bank.png";
35

46
import "./../../styles.scss";
57

8+
const customPartnerLogos = (
9+
<Logo url="https://www.patriabank.ro/" key="patria-bank">
10+
<img src={patriaBank} alt="Patria Bank" />
11+
</Logo>
12+
);
13+
14+
const customMultiplePartnersLogos = [
15+
<Logo url={"https://codeforall.org/"} key="github_3">
16+
<img
17+
src="https://epf.org.pl/en/wp-content/uploads/sites/3/2015/11/code_for_all_logo.png"
18+
alt="Custom Partner"
19+
/>
20+
</Logo>,
21+
<Logo url={"https://girlswhocode.com/"} key="github_4">
22+
<img
23+
src="http://www.bigdreammovement.com/wp-content/uploads/girls-who-code.png"
24+
alt="Custom Partner"
25+
/>
26+
</Logo>
27+
];
28+
629
export default { title: "Incubated By" };
730

831
export const normal = () => <IncubatedBy />;
32+
33+
export const withPartner = () => (
34+
<IncubatedBy partnerLogos={customPartnerLogos} />
35+
);
36+
37+
export const withMultiplePartners = () => (
38+
<IncubatedBy partnerLogos={customMultiplePartnersLogos} />
39+
);

src/images/patria-bank.png

5.84 KB
Loading

0 commit comments

Comments
 (0)