Skip to content

Commit 9add0be

Browse files
authored
Merge pull request #9 from python-chile/pch-feature/registration-external-links
feat(registration): add external registration links per city and enhance display on homepage and city pages. - Added external registration links per city - Improved the display of registration links on the homepage and city-specific pages - Adjusted styles for better usability and consistency
2 parents 9b0a1bd + cb5a6d4 commit 9add0be

File tree

6 files changed

+128
-30
lines changed

6 files changed

+128
-30
lines changed

src/app/[city]/page.js

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -66,14 +66,14 @@ export default async function CityPage({ params }) {
6666
<div className="grid grid-cols-1 md:grid-cols-2 gap-6 md:gap-10">
6767
{/* Columna de texto */}
6868
<div className="bg-black/20 backdrop-blur rounded-lg p-6 md:p-8">
69-
<h2 className="text-xl md:text-2xl font-bold mb-4 text-yellow-300">
69+
<h2 className="text-xl md:text-2xl font-bold mb-6 text-yellow-300">
7070
{data.introduction.title}
7171
</h2>
7272
<p className="text-base md:text-lg mb-6">
7373
{data.introduction.description}
7474
</p>
7575

76-
<h3 className="text-lg md:text-xl font-semibold mb-3 text-yellow-300">
76+
<h3 className="text-lg md:text-xl font-semibold mb-4 text-yellow-300">
7777
¿Cómo participar?
7878
</h3>
7979
<p className="text-base mb-5">
@@ -104,11 +104,8 @@ export default async function CityPage({ params }) {
104104

105105
{/* Registro Section */}
106106
<section id="registro" className="container-py">
107-
<FeatureGuard featureName="registration">
108-
<h2 className="section-title">Regístrate</h2>
109-
<div className="max-w-xl mx-auto px-13">
107+
<FeatureGuard featureName="registration"cityData={data}>
110108
<RegistrationForm />
111-
</div>
112109
</FeatureGuard>
113110
</section>
114111

src/app/page.js

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ import HeroSection from "@/components/HeroSection";
88
import SponsorList from "./sponsors/components/SponsorList";
99
import featuredTalks from "@/data/featuredTalks";
1010
import { FeatureGuard } from "@/components/FeatureManagement/FeatureGuard";
11+
import RegistrationState from "@/components/RegistrationState";
1112
import EmptyState from "@/components/EmptyState";
1213
import cityData from "@/data/cities";
1314

@@ -67,13 +68,9 @@ export default function Home() {
6768
</section>
6869

6970
{/* Registro Section */}
70-
<section id="registro" className="container-py">
71-
<FeatureGuard featureName="registration">
72-
<h2 className="section-title">Regístrate</h2>
73-
<div className="max-w-xl mx-auto px-13">
74-
<RegistrationForm />
75-
</div>
76-
</FeatureGuard>
71+
<section className="container-py">
72+
<h2 className="section-title">Registro PyDay 2025</h2>
73+
<RegistrationState context="global" />
7774
</section>
7875

7976
{/* Acerca de PyDay */}

src/components/EmptyState.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ export default function EmptyState({ cityId, context = "city" }) {
2424
links: city.talkProposalLink
2525
? [
2626
{
27-
name: `Proponer en ${city.name}`,
27+
name: `Proponer una charla para PyDay ${city.name}`,
2828
link: city.talkProposalLink,
2929
},
3030
]
Lines changed: 44 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,16 @@
11
import CTAFinal from "@/components/CTAFinal";
22

3-
export const FeatureGuard = ({ children, featureName }) => {
3+
export const FeatureGuard = ({ children, featureName, cityData }) => {
44
const features = {
55
registration: {
66
enabled: process.env.NEXT_PUBLIC_FEATURE_REGISTRATION === "true",
7-
title: "Registro PyDay 2025",
8-
subtitle: "El formulario de registro estará disponible próximamente",
9-
showCTA: false,
10-
buttonText: "Acceder al registro externo",
11-
href: "https://registro.externo.com/pyday",
7+
title: `Registro PyDay ${cityData?.name || "2025"}`,
8+
subtitle: cityData?.registrationLink
9+
? "¡Regístrate ahora para asegurar tu lugar en el PyDay 2025!"
10+
: "El registro abrirá próximamente. Mantente atento a nuestras redes sociales",
11+
showCTA: !!cityData?.registrationLink,
12+
buttonText: "Registrarme ahora",
13+
href: cityData?.registrationLink || "",
1214
},
1315
sponsors: {
1416
enabled: process.env.NEXT_PUBLIC_FEATURE_SPONSORS === "true",
@@ -32,13 +34,39 @@ export const FeatureGuard = ({ children, featureName }) => {
3234
const { enabled, ...ctaProps } = features[featureName];
3335

3436
return enabled ? (
35-
children
36-
) : ctaProps.showCTA ? (
37-
<CTAFinal {...ctaProps} />
38-
) : (
39-
<div className="text-center py-12">
40-
<h2 className="section-title">{ctaProps.title}</h2>
41-
<p className="text-white/80">{ctaProps.subtitle}</p>
42-
</div>
43-
);
44-
};
37+
<>
38+
<h2 className="section-title">Formulario de Registro</h2>
39+
{children}
40+
</>
41+
) : (
42+
<div className="text-center py-12">
43+
<h2 className="section-title">{ctaProps.title}</h2>
44+
<p className="text-white/80 mb-6">{ctaProps.subtitle}</p>
45+
{ctaProps.showCTA && (
46+
<a
47+
href={ctaProps.href}
48+
className="btn-secondary inline-flex items-center justify-center px-4 py-2 text-base"
49+
target="_blank"
50+
rel="noopener noreferrer"
51+
>
52+
{ctaProps.buttonText}
53+
<svg
54+
xmlns="http://www.w3.org/2000/svg"
55+
className="h-5 w-5 ml-2"
56+
viewBox="0 0 20 20"
57+
fill="currentColor"
58+
>
59+
<path
60+
fillRule="evenodd"
61+
d="M10.293 5.293a1 1 0 011.414 0l4 4a1 1 0 010 1.414l-4 4a1 1 0 01-1.414-1.414L12.586 11H5a1 1 0 110-2h7.586l-2.293-2.293a1 1 0 010-1.414z"
62+
clipRule="evenodd"
63+
/>
64+
</svg>
65+
</a>
66+
)}
67+
68+
</div>
69+
);
70+
};
71+
72+
Lines changed: 73 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,73 @@
1+
import Link from "next/link";
2+
import cityData from "@/data/cities";
3+
4+
export default function RegistrationState({ cityId }) {
5+
const citiesWithRegistration = Object.values(cityData)
6+
.filter((city) => !!city.registrationLink)
7+
.map((city) => ({
8+
name: city.name,
9+
link: city.registrationLink,
10+
}));
11+
12+
const getContent = () => {
13+
if (cityId) {
14+
const city = cityData[cityId];
15+
return {
16+
title: city.registrationLink ? "Registro disponible" : "Registro cerrado",
17+
message: city.registrationLink
18+
? `Inscríbete para PyDay ${city.name}`
19+
: `El registro para PyDay ${city.name} aún no está disponible.`,
20+
links: city.registrationLink ? [{ name: city.name, link: city.registrationLink }] : [],
21+
};
22+
}
23+
24+
return {
25+
title:
26+
citiesWithRegistration.length > 0
27+
? "¡Registro abierto! Cupos limitados"
28+
: "Registro cerrado",
29+
message:
30+
citiesWithRegistration.length > 0
31+
? "Elige tu ciudad y asegura tu lugar hoy"
32+
: "El registro abrirá próximamente. Síguenos en redes sociales.",
33+
links: citiesWithRegistration,
34+
};
35+
};
36+
37+
const { title, message, links } = getContent();
38+
39+
if (links.length === 0) return null;
40+
41+
return (
42+
<div className="backdrop-blur-sm rounded-lg p-6 md:p-8 text-center">
43+
<h3 className="text-lg md:text-xl font-bold mb-2 text-py-text">{title}</h3>
44+
<p className="text-py-text/80 mb-6">{message}</p>
45+
46+
<div className="flex flex-wrap justify-center gap-3 md:gap-4 w-full px-4">
47+
{links.map((city, index) => (
48+
<Link
49+
key={index}
50+
href={city.link}
51+
target="_blank"
52+
className="btn-secondary inline-flex items-center flex-shrink-0 px-4 py-2 text-sm md:text-base"
53+
>
54+
<span className="whitespace-nowrap">{city.name}</span>
55+
<svg
56+
xmlns="http://www.w3.org/2000/svg"
57+
className="h-4 w-4 md:h-5 md:w-5 ml-1.5"
58+
viewBox="0 0 20 20"
59+
fill="currentColor"
60+
>
61+
<path
62+
fillRule="evenodd"
63+
d="M10.293 5.293a1 1 0 011.414 0l4 4a1 1 0 010 1.414l-4 4a1 1 0 01-1.414-1.414L12.586 11H5a1 1 0 110-2h7.586l-2.293-2.293a1 1 0 010-1.414z"
64+
clipRule="evenodd"
65+
/>
66+
</svg>
67+
</Link>
68+
))}
69+
</div>
70+
</div>
71+
);
72+
}
73+

src/data/cities.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ const cityData = {
2323
participationInfo: "Participar te permitirá: adquirir nuevas habilidades, conectar con la comunidad tecnológica y descubrir cómo Python puede transformar tu futuro. ¡Te esperamos!",
2424
campusImage: "/images/campus/Inacap_Copiapo.webp",
2525
},
26+
registrationLink:"",
2627
talkProposalLink: "",
2728
schedule: allTalks.filter((talk) => talk.city === "copiapo"),
2829
},
@@ -48,6 +49,7 @@ const cityData = {
4849
participationInfo: "Participar te permitirá: adquirir nuevas habilidades, conectar con la comunidad tecnológica y descubrir cómo Python puede transformar tu futuro. ¡No te lo pierdas!",
4950
campusImage: "/images/campus/utfsm-campus.webp",
5051
},
52+
registrationLink:"https://www.eventbrite.com/e/1366605807759",
5153
talkProposalLink: "https://sessionize.com/pyday-valparaiso-2025/",
5254
schedule: allTalks.filter((talk) => talk.city === "valparaiso"),
5355
},
@@ -74,6 +76,7 @@ const cityData = {
7476
participationInfo: "Participar te permitirá: adquirir nuevas habilidades, conectar con la comunidad tecnológica local y descubrir cómo Python puede transformar tu futuro. ¡No te lo puedes perder!",
7577
campusImage: "/images/campus/DuocUC__San_Joaquín.webp",
7678
},
79+
registrationLink:"https://www.eventbrite.com/e/1366617793609",
7780
talkProposalLink: "https://sessionize.com/pyday-santiago-2025/",
7881
schedule: allTalks.filter((talk) => talk.city === "santiago"),
7982
},

0 commit comments

Comments
 (0)