Skip to content

Commit b825666

Browse files
Merge pull request #52 from code4rena-dev/leo95oliveira/new-icon-mapping
New mapping for icons
2 parents c390baf + 72e6398 commit b825666

File tree

3 files changed

+42
-10
lines changed

3 files changed

+42
-10
lines changed

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@code4rena/components-library",
3-
"version": "3.2.0",
3+
"version": "3.2.1",
44
"description": "Code4rena's official components library ",
55
"types": "./dist/lib.d.ts",
66
"exports": {

src/lib/ContestTile/CompactTemplate.tsx

Lines changed: 21 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -62,8 +62,16 @@ const IsContest = ({title, isDarkTile = true, contestData, sponsorUrl, sponsorIm
6262
const [contestTimelineObject, setContestTimelineObject] = useState<ContestSchedule | undefined>();
6363
const [hasBotRace, setHasBotRace] = useState(contestData ? !!contestData.botFindingsRepo : false);
6464
let ecosystemLogoName: string = "";
65-
if (ecosystem && (ecosystem === "Polkadot")) {
66-
ecosystemLogoName = 'logo-polkadot'
65+
if (ecosystem) {
66+
switch (ecosystem) {
67+
case "Polkadot":
68+
case "Blast":
69+
ecosystemLogoName = `logo-${ecosystem.toLowerCase()}`;
70+
break;
71+
default:
72+
ecosystemLogoName = "";
73+
break;
74+
}
6775
}
6876

6977
const updateContestTileStatus = useCallback(() => {
@@ -188,10 +196,18 @@ const IsBounty = ({title, isDarkTile = true, bountyData, sponsorUrl, sponsorImag
188196
}) => {
189197
const { amount, bountyUrl, ecosystem, languages } = bountyData;
190198
let ecosystemLogoName: string = "";
191-
if (ecosystem && (ecosystem === "Polkadot")) {
192-
ecosystemLogoName = 'logo-polkadot'
199+
if (ecosystem) {
200+
switch (ecosystem) {
201+
case "Polkadot":
202+
case "Blast":
203+
ecosystemLogoName = `logo-${ecosystem.toLowerCase()}`;
204+
break;
205+
default:
206+
ecosystemLogoName = "";
207+
break;
208+
}
193209
}
194-
210+
195211
return (
196212
<div className="body--bounty">
197213
<header>

src/lib/ContestTile/DefaultTemplate.tsx

Lines changed: 20 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -253,8 +253,16 @@ function IsContest({
253253
}) {
254254
const { contestUrl, amount, findingsRepo, startDate, endDate, ecosystem, languages } = contestData;
255255
let ecosystemLogoName: string = "";
256-
if (ecosystem && (ecosystem === "Polkadot")) {
257-
ecosystemLogoName = 'logo-polkadot'
256+
if (ecosystem) {
257+
switch (ecosystem) {
258+
case "Polkadot":
259+
case "Blast":
260+
ecosystemLogoName = `logo-${ecosystem.toLowerCase()}`;
261+
break;
262+
default:
263+
ecosystemLogoName = "";
264+
break;
265+
}
258266
}
259267

260268
return (
@@ -403,8 +411,16 @@ function IsBounty({
403411
const { bountyUrl, amount, startDate, ecosystem, languages } = bountyData;
404412
const endDate = "2999-01-01T00:00:00Z"
405413
let ecosystemLogoName: string = "";
406-
if (ecosystem && (ecosystem === "Polkadot")) {
407-
ecosystemLogoName = 'logo-polkadot'
414+
if (ecosystem) {
415+
switch (ecosystem) {
416+
case "Polkadot":
417+
case "Blast":
418+
ecosystemLogoName = `logo-${ecosystem.toLowerCase()}`;
419+
break;
420+
default:
421+
ecosystemLogoName = "";
422+
break;
423+
}
408424
}
409425

410426
return (

0 commit comments

Comments
 (0)