Skip to content

chore(website): add links to and widen Silver Supporters #6327

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
34 changes: 15 additions & 19 deletions packages/website/src/components/FinancialContributors/Sponsor.tsx
Original file line number Diff line number Diff line change
@@ -1,17 +1,17 @@
import React from 'react';

import styles from './styles.module.css';
import type { SponsorData, SponsorIncludeOptions } from './types';
import type { SponsorData } from './types';

interface SponsorProps {
include?: SponsorIncludeOptions;
includeName?: boolean;
sponsor: SponsorData;
}

export function Sponsor({ include = {}, sponsor }: SponsorProps): JSX.Element {
export function Sponsor({ includeName, sponsor }: SponsorProps): JSX.Element {
let children = <img alt={`${sponsor.name} logo`} src={sponsor.image} />;

if (include.name) {
if (includeName) {
children = (
<>
{children}
Expand All @@ -20,19 +20,15 @@ export function Sponsor({ include = {}, sponsor }: SponsorProps): JSX.Element {
);
}

if (include.link) {
children = (
<a
className={styles.sponsorLink}
href={sponsor.website ?? undefined}
title={sponsor.name}
target="_blank"
rel="noopener sponsored"
>
{children}
</a>
);
}

return children;
return (
<a
className={styles.sponsorLink}
href={sponsor.website ?? undefined}
title={sponsor.name}
target="_blank"
rel="noopener sponsored"
>
{children}
</a>
);
}
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,12 @@ import clsx from 'clsx';
import React from 'react';

import { Sponsor } from '../Sponsor';
import type { SponsorData, SponsorIncludeOptions } from '../types';
import type { SponsorData } from '../types';
import styles from './styles.module.css';

interface SponsorsProps {
className: string;
include?: SponsorIncludeOptions;
includeName?: boolean;
expanded?: boolean;
sponsors: SponsorData[];
title: string;
Expand All @@ -16,7 +16,7 @@ interface SponsorsProps {

export function Sponsors({
className,
include,
includeName,
title,
tier,
sponsors,
Expand All @@ -27,7 +27,7 @@ export function Sponsors({
<ul className={clsx(styles.sponsorsTier, styles[`tier-${tier}`])}>
{sponsors.map(sponsor => (
<li key={sponsor.id}>
<Sponsor include={include} sponsor={sponsor} />
<Sponsor includeName={includeName} sponsor={sponsor} />
</li>
))}
</ul>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,6 @@
.tierArea {
margin: 16px 0;
width: auto;
padding: 0 60px;
}

.tier-gold-supporter {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,14 +16,13 @@ export function FinancialContributors(): JSX.Element {
<div className={styles.sponsorsContainer}>
<Sponsors
className={styles.tierSponsorArea}
include={{ link: true, name: true }}
includeName
tier="platinum-sponsor"
title="Platinum Sponsors"
sponsors={sponsors.slice(0, 6)}
/>
<Sponsors
className={styles.tierSupporterArea}
include={{ link: true }}
tier="gold-supporter"
title="Gold Supporters"
sponsors={sponsors.slice(6, 16)}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,10 @@
margin: 48px 24px 24px;
}

.tierOtherArea {
padding: 0;
}

.become {
font-size: 1.25rem;
padding: 0.75rem 1.75rem;
Expand All @@ -36,12 +40,6 @@
max-width: 100%;
}

.tierArea {
margin: 16px 0;
width: auto;
padding: 0 60px;
}

.tierSponsorArea {
grid-area: 1 / 1 / 3 / 2;
}
Expand All @@ -50,6 +48,11 @@
grid-area: 1 / 2 / 2 / 3;
}

.tierSponsorArea,
.tierSupporterArea {
padding: 0 60px;
}

.tierOtherArea {
grid-area: 2 / 2 / 3 / 3;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,3 @@ export interface SponsorData {
totalDonations: number;
website?: string;
}

export interface SponsorIncludeOptions {
link?: boolean;
name?: boolean;
}