Skip to content

Commit 46537a5

Browse files
committed
fix: small patches and improvements
"section" semantic naming, named group for "links" to avoid underlining non-href cards, add section comments for improved scanability, and small adjustment to gradient border radius math
1 parent 4da3525 commit 46537a5

File tree

3 files changed

+14
-7
lines changed

3 files changed

+14
-7
lines changed

src/components/ui/card.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ import { cn } from "@/lib/utils/cn"
55

66
import { BaseLink } from "./Link"
77

8-
const titleVariants = cva("group-hover:underline", {
8+
const titleVariants = cva("group-hover/link:underline", {
99
variants: {
1010
variant: {
1111
bold: "text-2xl font-bold",
@@ -27,7 +27,7 @@ const Card = React.forwardRef<HTMLDivElement, CardProps>(
2727
<BaseLink
2828
href={href}
2929
className={cn(
30-
"group rounded-2xl text-body no-underline hover:text-body",
30+
"group/link rounded-2xl text-body no-underline hover:text-body",
3131
className
3232
)}
3333
hideArrow

src/components/ui/section.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ const Section = React.forwardRef<
66
HTMLDivElement,
77
React.HTMLAttributes<HTMLDivElement>
88
>(({ className, ...props }, ref) => (
9-
<div
9+
<section
1010
ref={ref}
1111
className={cn("flex flex-col gap-8 md:flex-row lg:gap-16", className)}
1212
{...props}

src/pages/index.tsx

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -223,8 +223,8 @@ const HomePage = ({
223223
))}
224224
</div>
225225

226-
{/* A new way to use the internet */}
227-
<div
226+
{/* Use Cases - A new way to use the internet */}
227+
<Section
228228
className={cn(
229229
"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
230230
"lg:grid lg:grid-cols-bento lg:gap-4" // Desktop: BentoBox grid
@@ -272,8 +272,9 @@ const HomePage = ({
272272
className={cn(className, "max-lg:hidden")} // Desktop only
273273
/>
274274
))}
275-
</div>
275+
</Section>
276276

277+
{/* Activity - The strongest ecosystem */}
277278
<Section>
278279
<SectionBanner>
279280
<TwImage src={ActivityImage} alt="" />
@@ -293,6 +294,7 @@ const HomePage = ({
293294
</SectionContent>
294295
</Section>
295296

297+
{/* Learn - Understand Ethereum */}
296298
<Section className="md:flex-row-reverse">
297299
<SectionBanner>
298300
<TwImage src={LearnImage} alt="" />
@@ -338,6 +340,7 @@ const HomePage = ({
338340

339341
{/* TODO: Add "The Internet Is Changing" section */}
340342

343+
{/* Builders - Blockchain's biggest builder community */}
341344
<Section>
342345
<SectionBanner>
343346
<TwImage src={BuildersImage} alt="" />
@@ -406,6 +409,7 @@ const HomePage = ({
406409
</SectionContent>
407410
</Section>
408411

412+
{/* Ethereum.org community - Built by the community */}
409413
<Section className="md:flex-row-reverse">
410414
<SectionBanner>
411415
<TwImage src={CommunityImage} alt="" />
@@ -494,6 +498,7 @@ const HomePage = ({
494498
</SectionContent>
495499
</Section>
496500

501+
{/* Recent posts */}
497502
<div className="w-full">
498503
<h3 className="mb-4 mt-2 text-4xl font-black lg:text-5xl">
499504
{t("page-index:page-index-posts-header")}
@@ -551,6 +556,7 @@ const HomePage = ({
551556
</div>
552557
</div>
553558

559+
{/* Event */}
554560
<div className="w-full">
555561
<h3 className="mb-4 mt-2 text-4xl font-black lg:text-5xl">
556562
{t("page-index:page-index-events-header")}
@@ -619,9 +625,10 @@ const HomePage = ({
619625
</div>
620626
</div>
621627

628+
{/* Join ethereum.org */}
622629
<div
623630
className={cn(
624-
"before:absolute before:-inset-px before:bottom-0 before:z-hide before:rounded-4xl before:content-['']", // Border/gradient positioning
631+
"before:absolute before:-inset-px before:bottom-0 before:z-hide before:rounded-[calc(theme(borderRadius.4xl)+1px)] before:content-['']", // Border/gradient positioning
625632
"before:bg-gradient-to-b before:from-primary-hover/[0.24] before:to-primary-hover/[0.08] before:dark:from-primary-hover/40 before:dark:to-primary-hover/20", // Border/gradient coloring
626633
"relative inset-0 rounded-4xl bg-background" // Paint background color over card portion
627634
)}

0 commit comments

Comments
 (0)