Skip to content

Commit 3099a96

Browse files
committed
fix: preserve medal proportions in Firefox
1 parent 3502cd6 commit 3099a96

3 files changed

Lines changed: 27 additions & 7 deletions

File tree

src/apps/opportunities/src/components/OpportunityListCard.module.scss

Lines changed: 17 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -273,12 +273,6 @@
273273
gap: 4px;
274274
white-space: nowrap;
275275

276-
svg {
277-
flex: 0 0 16px;
278-
height: 14.4px;
279-
width: 11.2px;
280-
}
281-
282276
strong {
283277
font-family: 'Nunito Sans', sans-serif;
284278
font-size: 16px;
@@ -287,6 +281,23 @@
287281
}
288282
}
289283

284+
.medalIcon {
285+
align-items: center;
286+
display: inline-flex;
287+
flex: 0 0 16px;
288+
height: 16px;
289+
justify-content: center;
290+
overflow: hidden;
291+
width: 16px;
292+
293+
svg {
294+
display: block;
295+
flex: none;
296+
height: 90%;
297+
width: 70%;
298+
}
299+
}
300+
290301
.morePrizes {
291302
align-items: center;
292303
background: #f5f7fa;

src/apps/opportunities/src/components/OpportunityListCard.spec.tsx

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -98,6 +98,13 @@ describe('OpportunityListCard competition presentation', () => {
9898
expect(within(prizes)
9999
.getByText('+1'))
100100
.toBeInTheDocument()
101+
const firstMedal = within(prizes)
102+
.getByText('$1000')
103+
.previousElementSibling
104+
expect(firstMedal)
105+
.toHaveClass('medalIcon')
106+
expect(firstMedal?.querySelector('svg'))
107+
.toBeInTheDocument()
101108
expect(screen.queryByText('Prize:'))
102109
.not.toBeInTheDocument()
103110

src/apps/opportunities/src/components/OpportunityListCard.tsx

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -308,7 +308,9 @@ function renderChallengePrizes(prizes: ChallengePlacementPrize[]): ReactNode {
308308
const MedalIcon = medalIcons[prize.placement - 1] ?? MedalThirdIcon
309309
return (
310310
<span className={styles.prize} key={`placement-${prize.placement}`}>
311-
<MedalIcon aria-hidden='true' />
311+
<span aria-hidden='true' className={styles.medalIcon}>
312+
<MedalIcon />
313+
</span>
312314
<strong>{formatPrize(prize)}</strong>
313315
</span>
314316
)

0 commit comments

Comments
 (0)