Skip to content

Commit 2070a88

Browse files
authored
Añadir tier 'Comunidades Patrocinadoras' para sponsors (#196)
1 parent 6dfd253 commit 2070a88

5 files changed

Lines changed: 29 additions & 44 deletions

File tree

src/components/home/SectionSponsors.astro

Lines changed: 21 additions & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
import { texts } from '../../i18n/home'
33
import SectionTitle from '../SectionTitle.astro'
44
import CenteredPanel from '../CenteredPanel.astro'
5-
import type { ISponsor } from '../../types/sponsors'
5+
import type { ISponsor, TSponsorTier } from '../../types/sponsors'
66
import SponsorsGroup from './sponsors/SponsorsGroup.astro'
77
88
const sponsors = Object.values(import.meta.glob('../../data/sponsors/*.md', { eager: true })) as {
@@ -16,59 +16,38 @@ interface Props {
1616
const { lang } = Astro.props
1717
const t = texts[lang as keyof typeof texts]
1818
19-
function filterSponsorsByTier(tier: string): ISponsor[] {
19+
function filterSponsorsByTier(tier: TSponsorTier): ISponsor[] {
2020
return sponsors
2121
.filter((s) => s.frontmatter.tier === tier)
2222
.map((s) => s.frontmatter)
2323
.sort((a, b) => a.name.localeCompare(b.name))
2424
}
2525
26-
const bronze = filterSponsorsByTier('bronze')
27-
const silver = filterSponsorsByTier('silver')
28-
const gold = filterSponsorsByTier('gold')
29-
const platinum = filterSponsorsByTier('platinum')
30-
const main = filterSponsorsByTier('main')
26+
const tierDefs: Array<{ key: TSponsorTier; size: number; color: string }> = [
27+
{ key: 'main', size: 280, color: 'text-tier-main' },
28+
{ key: 'platinum', size: 170, color: 'text-tier-platinum' },
29+
{ key: 'gold', size: 140, color: 'text-tier-gold' },
30+
{ key: 'silver', size: 110, color: 'text-tier-silver' },
31+
{ key: 'bronze', size: 90, color: 'text-tier-bronze' },
32+
{ key: 'community', size: 140, color: 'text-tier-community' },
33+
]
3134
---
3235

3336
<div class="flex flex-col items-center gap-6">
3437
<SectionTitle title={t['sponsors.title']} />
3538
<CenteredPanel text={t['sponsors.description']} />
3639

3740
<div class="w-full flex flex-col gap-10 mt-4">
38-
<SponsorsGroup
39-
lang={lang}
40-
title={t['sponsors.main']}
41-
sponsors={main}
42-
tierColor="text-tier-main"
43-
size={280}
44-
/>
45-
<SponsorsGroup
46-
lang={lang}
47-
title={t['sponsors.platinum']}
48-
sponsors={platinum}
49-
tierColor="text-tier-platinum"
50-
size={170}
51-
/>
52-
<SponsorsGroup
53-
lang={lang}
54-
title={t['sponsors.gold']}
55-
sponsors={gold}
56-
tierColor="text-tier-gold"
57-
size={140}
58-
/>
59-
<SponsorsGroup
60-
lang={lang}
61-
title={t['sponsors.silver']}
62-
sponsors={silver}
63-
tierColor="text-tier-silver"
64-
size={110}
65-
/>
66-
<SponsorsGroup
67-
lang={lang}
68-
title={t['sponsors.bronze']}
69-
sponsors={bronze}
70-
tierColor="text-tier-bronze"
71-
size={90}
72-
/>
41+
{
42+
tierDefs.map((tier) => (
43+
<SponsorsGroup
44+
lang={lang}
45+
title={t[`sponsors.${tier.key}`]}
46+
sponsors={filterSponsorsByTier(tier.key)}
47+
tierColor={tier.color}
48+
size={tier.size}
49+
/>
50+
))
51+
}
7352
</div>
7453
</div>

src/data/sponsors/eps.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
---
22
name: 'EuroPython Society'
33
website: 'https://www.europython-society.org/'
4-
tier: 'gold'
4+
tier: 'community'
55
logobg: '#ffffff'
66
logo: '/collaborators/europython.png'
77
---

src/i18n/home.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ export const texts = {
1212
'sponsors.gold': 'Patrocinador Oro',
1313
'sponsors.silver': 'Patrocinador Plata',
1414
'sponsors.bronze': 'Patrocinador Bronce',
15+
'sponsors.community': 'Comunidades Patrocinadoras',
1516
'sponsors.none': 'No hay patrocinadores en este nivel',
1617
'sponsors.altlogo': 'Logo de {name}',
1718
'cfp.title': 'Llamada a Propuestas',
@@ -37,6 +38,7 @@ export const texts = {
3738
'sponsors.gold': 'Gold Sponsor',
3839
'sponsors.silver': 'Silver Sponsor',
3940
'sponsors.bronze': 'Bronze Sponsor',
41+
'sponsors.community': 'Sponsoring Communities',
4042
'sponsors.none': 'No sponsors in this tier',
4143
'sponsors.altlogo': '{name} logo',
4244
'cfp.title': 'Call for Proposals',
@@ -63,6 +65,7 @@ export const texts = {
6365
'sponsors.gold': 'Patrocinador Or',
6466
'sponsors.silver': 'Patrocinador Plata',
6567
'sponsors.bronze': 'Patrocinador Bronze',
68+
'sponsors.community': 'Comunitats Patrocinadores',
6669
'sponsors.none': 'No hi ha patrocinadors en aquest nivell',
6770
'sponsors.altlogo': 'Logo de {name}',
6871
'cfp.title': 'Crida a Propostes',

src/style/global.css

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -96,6 +96,9 @@ html {
9696

9797
--color-tier-bronze: var(--color-pycon-gray);
9898
--color-contrast-tier-bronze: #ffffff;
99+
100+
--color-tier-community: #4a6fa5;
101+
--color-contrast-tier-community: #ffffff;
99102
}
100103

101104
@layer base {

src/types/sponsors.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
export type TSponsorTier = 'bronze' | 'silver' | 'gold' | 'platinum' | 'main'
1+
export type TSponsorTier = 'bronze' | 'silver' | 'gold' | 'platinum' | 'main' | 'community'
22

33
export interface ISponsor {
44
name: string

0 commit comments

Comments
 (0)