Skip to content

Commit 1dd78d9

Browse files
authored
Merge pull request #22 from code4rena-dev/samus/fix-bugs-21
Fix some small bugs
2 parents 133c334 + c63e625 commit 1dd78d9

File tree

3 files changed

+16
-12
lines changed

3 files changed

+16
-12
lines changed

package-lock.json

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/lib/Card/Card.tsx

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import clsx from "clsx";
2-
import React from "react";
2+
import React, { Fragment } from "react";
33
import { CardImageBorderRadius, CardImageSize, CardProps } from "./Card.types";
44
import { Button } from "../Button";
55
import { ButtonSize, ButtonType, ButtonVariant } from "../Button/Button.types";
@@ -8,14 +8,14 @@ import "./Card.scss";
88
/**
99
* A stylized Code4rena card with 4 variants and optional footer, cta button, and title.
1010
* Requires an image tag for the top left corner and children for the body.
11-
*
11+
*
1212
* __Available variants:__
1313
* - `TRANSPARENT` - makes the background of the card transparent
1414
* - `OUTLINED` - adds border around the card
1515
* - `COMPACT` - displays the body below the image to allow the card to be more narrow
1616
* - `BOTTOM_ALIGNED` - makes the title and body bottom aligned instead of top aligned
17-
*
18-
* @param children - Elements to be rendered inside the body of the card, passed in as children.
17+
*
18+
* @param children - Elements to be rendered inside the body of the card, passed in as children.
1919
* @param className - String of custom classes to extend the default styling of the component.
2020
* @param variants - Array of style variants to be applied to the rendered component.
2121
* @param footerDetails - Informational content to be rendered on the left side of the footer.
@@ -78,7 +78,9 @@ export const Card: React.FC<CardProps> = ({
7878
)}
7979
{footerLinks && (
8080
<div className="card__footer-link-wrapper">
81-
{footerLinks.map((link) => link)}
81+
{footerLinks.map((link, index) => (
82+
<Fragment key={index}>{link}</Fragment>
83+
))}
8284
</div>
8385
)}
8486
</footer>

src/lib/ContestTile/ContestTile.tsx

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -358,7 +358,7 @@ export const ContestTile: React.FC<ContestTileProps> = ({
358358
status={contestTimelineObject.contestStatus}
359359
/>
360360
{contestTimelineObject.contestStatus !== Status.ENDED && (
361-
<p className="tile--footer--timer">
361+
<div className="tile--footer--timer">
362362
<Countdown
363363
start={startDate}
364364
end={endDate}
@@ -369,7 +369,7 @@ export const ContestTile: React.FC<ContestTileProps> = ({
369369
: "Ends in "
370370
}
371371
/>
372-
</p>
372+
</div>
373373
)}
374374
</span>
375375
<p className="tile--body--contesttypecompact">{contestType}</p>
@@ -387,7 +387,7 @@ export const ContestTile: React.FC<ContestTileProps> = ({
387387
status={contestTimelineObject.contestStatus}
388388
/>
389389
{contestTimelineObject.contestStatus !== Status.ENDED && (
390-
<p className="tile--footer--timer">
390+
<div className="tile--footer--timer">
391391
<Countdown
392392
start={startDate}
393393
end={endDate}
@@ -398,7 +398,7 @@ export const ContestTile: React.FC<ContestTileProps> = ({
398398
: "Ends in "
399399
}
400400
/>
401-
</p>
401+
</div>
402402
)}
403403
</div>
404404
<div className="tile--footer--options">
@@ -425,9 +425,10 @@ export const ContestTile: React.FC<ContestTileProps> = ({
425425
hideDownArrow={true}
426426
openOnHover={true}
427427
>
428-
{dropdownLinks?.map((link) =>
428+
{dropdownLinks?.map((link, index) =>
429429
link.external ? (
430430
<a
431+
key={`${link.label}-${index}`}
431432
href={link.href}
432433
target="_blank"
433434
rel="noreferrer noopener"
@@ -440,6 +441,7 @@ export const ContestTile: React.FC<ContestTileProps> = ({
440441
</a>
441442
) : (
442443
<a
444+
key={`${link.label}-${index}`}
443445
href={link.href}
444446
aria-label={link.ariaLabel ?? link.label}
445447
className="c4dropdown--button"

0 commit comments

Comments
 (0)