Skip to content

Commit c5694fe

Browse files
committed
feat: introduce VenueWTC component and dynamically render travel venue information based on route parameters, adding new images and minor styling adjustments.
1 parent eea6a43 commit c5694fe

6 files changed

Lines changed: 167 additions & 6 deletions

File tree

public/images/wtc-auditorio.jpg

629 KB
Loading

public/images/wtc.jpg

248 KB
Loading

src/components/SectionTitle/TitleSection.tsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,8 +44,9 @@ const StyledTitle = styled.h1`
4444
}
4545
`;
4646

47-
const StyledSubTitle = styled.p`
47+
const StyledSubTitle = styled.h2`
4848
color: ${(props) => props.color ?? Color.WHITE};
49+
margin-top: 1rem;
4950
@media (min-width: 480px) {
5051
width: 70%;
5152
}

src/constants/routes.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ export const ROUTE_SESSION_FEEDBACK = "/session-feedback";
2323
export const ROUTE_TALK_DETAIL = "/talk";
2424
export const ROUTE_WORKSHOPS = "/workshops";
2525
export const ROUTE_MEETING_DETAIL_PLAIN = "/talk/:id";
26-
export const ROUTE_TRAVEL = "/travel";
26+
export const ROUTE_TRAVEL = ":id/travel";
2727
export const ROUTE_ACCOMMODATION = "/accommodation";
2828

2929
// 2026

src/views/Travel/Travel.tsx

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
1-
import React, { FC } from "react";
1+
import { useParams } from "react-router";
22
import { Venue } from "./Venue";
33
import { ToBarcelona } from "./ToBarcelona";
4-
import data from "@data/2024.json";
54
import { StyledWaveContainer } from "../Speakers/Speakers.style";
65
import { styled } from "styled-components";
76
import { Color } from "@styles/colors";
87
import { Accommodation } from "./Accommodation";
98
import { useDocumentTitleUpdater } from "@hooks/useDocumentTitleUpdate";
9+
import { VenueWTC } from "./VenueWTC";
1010

1111
const StyledTravel = styled.div`
1212
max-width: 85rem;
@@ -33,11 +33,14 @@ const StyledTravel = styled.div`
3333
`;
3434

3535
const Travel: FC<React.PropsWithChildren<unknown>> = () => {
36-
useDocumentTitleUpdater("Travel", data.edition);
36+
const { id } = useParams<{ id: string }>();
37+
const edition = id || "2026";
38+
39+
useDocumentTitleUpdater("Travel", edition);
3740
return (
3841
<StyledTravel>
3942
<section>
40-
<Venue />
43+
{edition === "2026" ? <VenueWTC /> : <Venue />}
4144
</section>
4245
<section style={{ display: "none" }}>
4346
<Accommodation />

src/views/Travel/VenueWTC.tsx

Lines changed: 157 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,157 @@
1+
import React, { FC, Suspense } from "react";
2+
import "./map.css";
3+
import { styled } from "styled-components";
4+
import TitleSection from "@components/SectionTitle/TitleSection";
5+
import { Color } from "@styles/colors";
6+
import {
7+
BIG_BREAKPOINT,
8+
MAX_WIDTH,
9+
MOBILE_BREAKPOINT,
10+
} from "@constants/BreakPoints";
11+
import { useWindowSize } from "react-use";
12+
import { StyledLoadingImage } from "@components/Loading/Loading";
13+
14+
const StyledVenue = styled.div`
15+
padding: 0.5rem 2rem 0.5rem;
16+
text-align: left;
17+
max-width: ${MAX_WIDTH}px;
18+
margin: 0 auto;
19+
20+
@media (max-width: ${BIG_BREAKPOINT}px) {
21+
padding: 100px 1rem 50px;
22+
}
23+
24+
.image {
25+
img.venue {
26+
width: 95%;
27+
margin: 0 2.5%;
28+
text-align: center;
29+
}
30+
31+
a,
32+
p {
33+
padding-left: 10px;
34+
}
35+
36+
a {
37+
text-decoration: none;
38+
color: ${Color.DARK_BLUE};
39+
font-weight: bold;
40+
}
41+
}
42+
43+
section.venue {
44+
display: flex;
45+
@media (max-width: ${BIG_BREAKPOINT}px) {
46+
flex-direction: column;
47+
}
48+
}
49+
50+
h4 {
51+
margin: 15px 0 3px 10px;
52+
}
53+
54+
.image,
55+
.map {
56+
width: 50%;
57+
@media (max-width: ${BIG_BREAKPOINT}px) {
58+
width: 100%;
59+
}
60+
}
61+
`;
62+
63+
const StyledTrainLine = styled.span`
64+
background-color: #00f200;
65+
font-weight: bold;
66+
padding: 1px 2px;
67+
font-family: sans-serif;
68+
font-size: 12px;
69+
`;
70+
export const StyledLessIcon = styled.img`
71+
position: absolute;
72+
left: -1rem;
73+
top: 5rem;
74+
height: 5rem;
75+
76+
@media (min-width: ${BIG_BREAKPOINT}px) {
77+
height: 10rem;
78+
}
79+
`;
80+
export const StyledMoreIcon = styled.img`
81+
position: absolute;
82+
right: -1rem;
83+
top: 5rem;
84+
height: 5rem;
85+
86+
@media (min-width: ${BIG_BREAKPOINT}px) {
87+
height: 10rem;
88+
}
89+
`;
90+
91+
export const VenueWTC: FC<React.PropsWithChildren<unknown>> = () => {
92+
const { width } = useWindowSize();
93+
return (
94+
<StyledVenue>
95+
<TitleSection
96+
title={"Venue"}
97+
subtitle={"World Trade Center, Barcelona"}
98+
color={Color.DARK_BLUE}
99+
/>
100+
{width > MOBILE_BREAKPOINT && (
101+
<>
102+
<StyledLessIcon src="/images/MoreThanBlueWhiteIcon.svg" />
103+
<StyledMoreIcon src="/images/LessThanBlueWhiteIcon.svg" />
104+
</>
105+
)}
106+
<section className="venue">
107+
<div className="image">
108+
<Suspense fallback={<StyledLoadingImage src="/images/logo.svg" />}>
109+
<img
110+
src="/images/wtc.jpg"
111+
style={{ aspectRatio: "285/173" }}
112+
alt="World Trade Center, Barcelona"
113+
className="venue"
114+
/>
115+
</Suspense>
116+
<a
117+
href="https://www.wtcbarcelona.com/"
118+
rel="noreferrer"
119+
target="_blank"
120+
title="World Trade Center, Barcelona"
121+
>
122+
World Trade Center, Barcelona
123+
</a>
124+
<p>
125+
1ª planta Edif. Este, Moll de Barcelona, s/n, 08039 Barcelona
126+
</p>
127+
<h4>Access by public transportation</h4>
128+
<p>🚇 Metro: Líneas L3: Parada Drassanes, Línea L2: Parada Paral·lel.</p>
129+
<p>
130+
🚍 Bus: Línea V11, parada Moll de Barcelona.
131+
</p>
132+
<p>
133+
🚙 Access by <strong>car:</strong> via C-31 & B-10(14 minutes from the
134+
Airport)
135+
</p>
136+
<h4>Paid parking options</h4>
137+
<p>
138+
<a
139+
href="https://www.wtcbarcelona.com/"
140+
rel="noreferrer"
141+
target="_blank"
142+
>
143+
World Trade Center, Barcelona
144+
</a>
145+
</p>
146+
</div>
147+
<div className="map">
148+
<img
149+
src="/images/wtc-auditorio.jpg"
150+
alt="Venue entrance"
151+
style={{ maxWidth: "100%" }}
152+
/>
153+
</div>
154+
</section>
155+
</StyledVenue>
156+
);
157+
};

0 commit comments

Comments
 (0)