diff --git a/i18n/en.json b/i18n/en.json index e7d218a7..752d97ed 100644 --- a/i18n/en.json +++ b/i18n/en.json @@ -239,6 +239,10 @@ "total": "Total", "winner": "🏆 Winner", "notPrizeNote": "Not eligible for the prize." + }, + "membership": { + "message": "Hackathons are for NaN members. Join the community (from €14.99/month) to take part.", + "cta": "Join the community" } }, "nan": { diff --git a/i18n/es.json b/i18n/es.json index a932b8ed..76a1879d 100644 --- a/i18n/es.json +++ b/i18n/es.json @@ -239,6 +239,10 @@ "total": "Total", "winner": "🏆 Ganador", "notPrizeNote": "No opta al premio." + }, + "membership": { + "message": "Los hackathons son para miembros de NaN. Únete a la comunidad (desde 14,99 €/mes) para participar.", + "cta": "Únete a la comunidad" } }, "nan": { diff --git a/src/components/events/MembershipRequired.tsx b/src/components/events/MembershipRequired.tsx new file mode 100644 index 00000000..7228ea74 --- /dev/null +++ b/src/components/events/MembershipRequired.tsx @@ -0,0 +1,22 @@ +import { HACKATHON_UNLOCK_URL, type MembershipStrings } from '../../lib/eventEntitlement'; + +/** + * Shown when cloud-api answers `entitlement_required`: the account has no + * plan that unlocks hackathons. Says so and links to the community plan. + */ +export default function MembershipRequired({ t, compact = false }: { t: MembershipStrings; compact?: boolean }) { + if (compact) { + return ( + + {t.message}{' '} + {t.cta} → + + ); + } + return ( +
{t.message}
+ {t.cta} → +{labels.errorSubmit}
} + {state === 'membership' &&