Skip to content

Commit d270af2

Browse files
committed
Merge branch 'dev' into morpher-refactor
2 parents beef6d0 + 1f65410 commit d270af2

File tree

7 files changed

+58
-16
lines changed

7 files changed

+58
-16
lines changed

app/[locale]/10years/_components/AdoptionSwiper.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ const AdoptionSwiper = ({
2424
return (
2525
<div className="flex flex-1 flex-col gap-6 md:hidden">
2626
<SwiperContainer className="mx-auto w-full max-w-[550px]">
27-
<Swiper>
27+
<Swiper spaceBetween={32}>
2828
{adoptionCards.map((card, index) => (
2929
<SwiperSlide key={card.title}>
3030
<div

app/[locale]/10years/_components/InnovationSwiper.tsx

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,10 @@ export default function InnovationSwiper() {
1414
return (
1515
<div className="w-[100%]">
1616
<SwiperContainer className="mx-auto w-full max-w-[550px] xl:max-w-[700px]">
17-
<Swiper className="mx-auto w-full max-w-[550px] xl:max-w-[700px]">
17+
<Swiper
18+
className="mx-auto w-full max-w-[550px] xl:max-w-[700px]"
19+
spaceBetween={32}
20+
>
1821
{innovationCards.map((card, index) => (
1922
<SwiperSlide
2023
key={index}

app/[locale]/10years/_components/TenYearGlobe.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ const TenYearGlobe = ({ events }: { events: EventData[] }) => {
4848
const atmosphereColor = resolvedTheme === "dark" ? "#B38DF0" : "#945AF4"
4949

5050
const width = useBreakpointValue({
51-
base: 260,
51+
base: window?.innerWidth - 64 || 260, // Full width on mobile with padding
5252
sm: 400,
5353
md: 500,
5454
lg: 600,
@@ -237,8 +237,8 @@ const TenYearGlobe = ({ events }: { events: EventData[] }) => {
237237
return (
238238
<div
239239
ref={globeContainerRef}
240-
className="relative cursor-grab active:cursor-grabbing"
241-
style={{ width: width, height: width }}
240+
className="relative w-full max-w-full cursor-grab active:cursor-grabbing"
241+
style={{ height: width }}
242242
>
243243
{MemoizedGlobe}
244244
{hoveredEvent && tooltipPos && (

app/[locale]/10years/_components/TenYearHomeBanner.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,11 +15,11 @@ const TenYearHomeBanner = () => {
1515
<ParallaxImage
1616
src={TenYearGraphicImage}
1717
alt=""
18-
className="mx-auto -mb-2 -mt-16 max-w-[500px] object-contain sm:-mt-24 md:-mt-32"
18+
className="mx-auto -mb-2 -mt-16 max-w-[min(100%,500px)] object-contain sm:-mt-24 md:-mt-32"
1919
/>
20-
<div className="flex justify-center">
20+
<div className="mt-4 flex justify-center">
2121
<TenYearDesktopText className="mb-4 hidden object-contain text-body md:block" />
22-
<TenYearMobileText className="mb-4 block object-contain text-body md:hidden" />
22+
<TenYearMobileText className="mb-4 block object-contain text-5xl text-body md:hidden" />
2323
</div>
2424
<div className="mb-4 flex flex-col gap-2">
2525
<p>

public/images/10-year-anniversary/10yeartext-mobile.svg

Lines changed: 1 addition & 1 deletion
Loading

src/data/mocks/fetched10YearEvents.json

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -189,8 +189,8 @@
189189
}
190190
]
191191
},
192-
"central & south ameirca": {
193-
"label": "Central & South Ameirca",
192+
"central & south america": {
193+
"label": "Central & South America",
194194
"events": [
195195
{
196196
"host": "Nodo Serrano",
@@ -201,7 +201,7 @@
201201
"city": "Tandil",
202202
"country": "Argentina",
203203
"region": "Central & South America",
204-
"continent": "Central & South Ameirca",
204+
"continent": "Central & South America",
205205
"lat": "-37.3288",
206206
"lng": "-59.1367",
207207
"readyToShow": "TRUE",
@@ -216,7 +216,7 @@
216216
"city": "Monterrey",
217217
"country": "Mexico",
218218
"region": "Central & South America",
219-
"continent": "Central & South Ameirca",
219+
"continent": "Central & South America",
220220
"lat": "25.6866",
221221
"lng": "-100.3161",
222222
"readyToShow": "TRUE",
@@ -231,7 +231,7 @@
231231
"city": "Cochabamba",
232232
"country": "Bolivia",
233233
"region": "Central & South America",
234-
"continent": "Central & South Ameirca",
234+
"continent": "Central & South America",
235235
"lat": "-17.382",
236236
"lng": "-66.1596",
237237
"readyToShow": "TRUE",
@@ -246,7 +246,7 @@
246246
"city": "Florianópolis",
247247
"country": "Brazil",
248248
"region": "Central & South America",
249-
"continent": "Central & South Ameirca",
249+
"continent": "Central & South America",
250250
"lat": "-27.5969",
251251
"lng": "-48.5468",
252252
"readyToShow": "TRUE",
@@ -389,4 +389,4 @@
389389
}
390390
]
391391
}
392-
}
392+
}

src/hooks/useRefWidth.ts

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
"use client"
2+
3+
import { type RefObject, useEffect, useState } from "react"
4+
5+
import { useEventListener } from "./useEventListener"
6+
7+
export const useRefWidth = (
8+
ref: RefObject<HTMLElement>,
9+
padding: number = 0
10+
): number => {
11+
const [width, setWidth] = useState(0)
12+
13+
const updateWidth = () => {
14+
if (ref.current) {
15+
const rect = ref.current.getBoundingClientRect()
16+
setWidth(Math.max(0, rect.width - padding))
17+
}
18+
}
19+
20+
// Use the internal useEventListener for window resize
21+
useEventListener("resize", updateWidth)
22+
23+
useEffect(() => {
24+
// Initial measurement
25+
updateWidth()
26+
27+
// Create ResizeObserver for more accurate monitoring
28+
const resizeObserver = new ResizeObserver(updateWidth)
29+
if (ref.current) {
30+
resizeObserver.observe(ref.current)
31+
}
32+
33+
return () => {
34+
resizeObserver.disconnect()
35+
}
36+
}, [ref, padding])
37+
38+
return width
39+
}

0 commit comments

Comments
 (0)