Skip to content

Commit d77ac49

Browse files
committed
refactor: rm single-use bentobox and title,
restructure "a new way to use the internet" section to use a single structure within pages/index.tsx, using classnames to handle mobile vs desktop accordingly
1 parent 82b4999 commit d77ac49

File tree

3 files changed

+32
-52
lines changed

3 files changed

+32
-52
lines changed

src/components/BentoBox/Title.tsx

Lines changed: 0 additions & 22 deletions
This file was deleted.

src/components/BentoBox/index.tsx

Lines changed: 0 additions & 22 deletions
This file was deleted.

src/pages/index.tsx

Lines changed: 32 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -13,9 +13,7 @@ import type {
1313
RSSItem,
1414
} from "@/lib/types"
1515

16-
import BentoBox from "@/components/BentoBox"
1716
import BentoCard from "@/components/BentoBox/BentoCard"
18-
import Title from "@/components/BentoBox/Title"
1917
import SvgButtonLink from "@/components/Buttons/SvgButtonLink"
2018
import CodeModal from "@/components/CodeModal"
2119
import HomeHero from "@/components/Hero/HomeHero"
@@ -225,12 +223,32 @@ const HomePage = ({
225223
))}
226224
</div>
227225

228-
{/* Mobile */}
229-
<div className="-mx-4 w-[100vw] overflow-hidden px-4 sm:-mx-6 sm:px-6 lg:hidden">
230-
<Title />
226+
{/* A new way to use the internet */}
227+
<div
228+
className={cn(
229+
"max-lg:-mx-4 max-lg:w-[100vw] max-lg:overflow-hidden max-lg:px-4 sm:max-lg:-mx-6 sm:max-lg:px-6", // Mobile: Swiper cards
230+
"lg:grid lg:grid-cols-bento lg:gap-4" // Desktop: BentoBox grid
231+
)}
232+
>
233+
<div
234+
className={cn(
235+
"flex flex-col",
236+
"lg:col-span-12 lg:flex xl:col-span-3 xl:col-start-2"
237+
)}
238+
>
239+
<div className="w-fit rounded-full bg-primary-low-contrast px-4 py-0 text-sm uppercase text-primary">
240+
{t("common:nav-use-cases-label")}
241+
</div>
242+
<h2 className="mb-4 me-4 mt-2 text-5xl font-black xl:mb-6 xl:text-7xl">
243+
{t("page-index:page-index-bento-header")}
244+
</h2>
245+
</div>
246+
247+
{/* Mobile */}
231248
<Swiper
232249
options={{ effect: "cards", createElements: true }}
233250
className={cn(
251+
"lg:hidden", // Mobile only
234252
"[&_.swiper-slide]:overflow-visible [&_.swiper-slide]:rounded-2xl [&_.swiper-slide]:shadow-card-hover",
235253
"[&_.swiper]:mx-auto [&_.swiper]:mt-4 [&_.swiper]:!flex [&_.swiper]:h-fit [&_.swiper]:max-w-128 [&_.swiper]:flex-col [&_.swiper]:items-center"
236254
)}
@@ -245,10 +263,16 @@ const HomePage = ({
245263
/>
246264
))}
247265
</Swiper>
248-
</div>
249266

250-
{/* Desktop */}
251-
<BentoBox className="hidden lg:block" />
267+
{/* Desktop */}
268+
{bentoItems.map(({ className, ...item }) => (
269+
<BentoCard
270+
key={item.title}
271+
{...item}
272+
className={cn(className, "max-lg:hidden")} // Desktop only
273+
/>
274+
))}
275+
</div>
252276

253277
<Section>
254278
<SectionBanner>

0 commit comments

Comments
 (0)