Fix featured grid
This commit is contained in:
@@ -1,11 +1,11 @@
|
||||
"use client";
|
||||
|
||||
/**
|
||||
* Figma: "Sections / FeatureGrid" (see registry)
|
||||
* Figma: "Section / Feature-Grid" (18847:22410)
|
||||
*/
|
||||
|
||||
import { memo, useMemo } from "react";
|
||||
import { getAssetPath, featurePanelPath } from "../../../../lib/assetUtils";
|
||||
import { getAssetPath, featurePanelLayout, featurePanelPath } from "../../../../lib/assetUtils";
|
||||
import { useTranslation } from "../../../contexts/MessagesContext";
|
||||
import FeatureGridView from "./FeatureGrid.view";
|
||||
import type { FeatureGridProps, Feature } from "./FeatureGrid.types";
|
||||
@@ -17,7 +17,7 @@ const FeatureGridContainer = memo<FeatureGridProps>(
|
||||
const features: Feature[] = useMemo(
|
||||
() => [
|
||||
{
|
||||
backgroundColor: "bg-[var(--color-surface-default-brand-royal)]",
|
||||
backgroundColor: "bg-[var(--color-surface-invert-brand-royal)]",
|
||||
labelLine1: t(
|
||||
"pages.home.featureGrid.features.decisionMaking.labelLine1",
|
||||
),
|
||||
@@ -25,11 +25,12 @@ const FeatureGridContainer = memo<FeatureGridProps>(
|
||||
"pages.home.featureGrid.features.decisionMaking.labelLine2",
|
||||
),
|
||||
panelContent: getAssetPath(featurePanelPath("support")),
|
||||
...featurePanelLayout("support"),
|
||||
ariaLabel: t("featureGrid.features.decisionMaking.ariaLabel"),
|
||||
href: "#decision-making",
|
||||
},
|
||||
{
|
||||
backgroundColor: "bg-[#D1FFE2]",
|
||||
backgroundColor: "bg-[var(--color-surface-invert-brand-lime)]",
|
||||
labelLine1: t(
|
||||
"pages.home.featureGrid.features.valuesAlignment.labelLine1",
|
||||
),
|
||||
@@ -37,11 +38,12 @@ const FeatureGridContainer = memo<FeatureGridProps>(
|
||||
"pages.home.featureGrid.features.valuesAlignment.labelLine2",
|
||||
),
|
||||
panelContent: getAssetPath(featurePanelPath("exercises")),
|
||||
...featurePanelLayout("exercises"),
|
||||
ariaLabel: t("featureGrid.features.valuesAlignment.ariaLabel"),
|
||||
href: "#values-alignment",
|
||||
},
|
||||
{
|
||||
backgroundColor: "bg-[#F4CAFF]",
|
||||
backgroundColor: "bg-[var(--color-surface-invert-brand-rust)]",
|
||||
labelLine1: t(
|
||||
"pages.home.featureGrid.features.membershipGuidance.labelLine1",
|
||||
),
|
||||
@@ -49,11 +51,12 @@ const FeatureGridContainer = memo<FeatureGridProps>(
|
||||
"pages.home.featureGrid.features.membershipGuidance.labelLine2",
|
||||
),
|
||||
panelContent: getAssetPath(featurePanelPath("guidance")),
|
||||
...featurePanelLayout("guidance"),
|
||||
ariaLabel: t("featureGrid.features.membershipGuidance.ariaLabel"),
|
||||
href: "#membership-guidance",
|
||||
},
|
||||
{
|
||||
backgroundColor: "bg-[#CBDDFF]",
|
||||
backgroundColor: "bg-[var(--color-surface-invert-brand-teal)]",
|
||||
labelLine1: t(
|
||||
"pages.home.featureGrid.features.conflictResolution.labelLine1",
|
||||
),
|
||||
@@ -61,6 +64,7 @@ const FeatureGridContainer = memo<FeatureGridProps>(
|
||||
"pages.home.featureGrid.features.conflictResolution.labelLine2",
|
||||
),
|
||||
panelContent: getAssetPath(featurePanelPath("tools")),
|
||||
...featurePanelLayout("tools"),
|
||||
ariaLabel: t("featureGrid.features.conflictResolution.ariaLabel"),
|
||||
href: "#conflict-resolution",
|
||||
},
|
||||
|
||||
@@ -9,6 +9,9 @@ export interface Feature {
|
||||
labelLine1: string;
|
||||
labelLine2: string;
|
||||
panelContent: string;
|
||||
panelWidth: number;
|
||||
panelHeight: number;
|
||||
panelImageClassName?: string;
|
||||
ariaLabel: string;
|
||||
href: string;
|
||||
}
|
||||
|
||||
@@ -5,6 +5,7 @@ import ContentLockup from "../../type/ContentLockup";
|
||||
import Mini from "../../cards/Mini";
|
||||
import type { FeatureGridViewProps } from "./FeatureGrid.types";
|
||||
|
||||
/** Figma **Section / Feature-Grid** [18847:22410](https://www.figma.com/design/agv0VBLiBlcnSAaiAORgPR/Community-Rule-System?node-id=18847-22410&m=dev). */
|
||||
function FeatureGridView({
|
||||
title,
|
||||
subtitle,
|
||||
@@ -23,10 +24,12 @@ function FeatureGridView({
|
||||
aria-labelledby={labelledBy}
|
||||
aria-label={labelledBy ? undefined : ariaLabel}
|
||||
>
|
||||
<div className="py-[var(--spacing-scale-032)] px-[var(--spacing-scale-020)] md:pt-[var(--spacing-scale-076)] md:pb-[var(--spacing-scale-048)] lg:pb-[var(--spacing-scale-076)] md:px-[var(--spacing-scale-048)] bg-[#171717] rounded-[var(--radius-measures-radius-xlarge)] focus-within:ring-2 focus-within:ring-[var(--color-surface-default-brand-royal)] focus-within:ring-offset-2">
|
||||
<div className="w-full mx-auto gap-[var(--spacing-scale-048)] lg:flex lg:items-start lg:gap-[var(--spacing-scale-048)] [container-type:inline-size]">
|
||||
{/* Feature Content Lockup */}
|
||||
<div className="lg:shrink lg:min-w-0">
|
||||
<div
|
||||
data-figma-node="18847-22410"
|
||||
className="rounded-[var(--measures-radius-500,20px)] bg-[var(--color-surface-default-secondary)] px-[var(--spacing-scale-020)] py-[var(--spacing-scale-032)] focus-within:ring-2 focus-within:ring-[var(--color-surface-default-brand-royal)] focus-within:ring-offset-2 md:px-[var(--spacing-scale-048)] md:pb-[var(--spacing-scale-048)] md:pt-[var(--spacing-scale-076)] lg:pb-[var(--spacing-scale-076)]"
|
||||
>
|
||||
<div className="mx-auto w-full gap-[var(--spacing-scale-048)] [container-type:inline-size] lg:flex lg:items-start lg:gap-[var(--spacing-scale-048)]">
|
||||
<div className="lg:min-w-0 lg:shrink">
|
||||
<ContentLockup
|
||||
title={title}
|
||||
subtitle={subtitle}
|
||||
@@ -37,17 +40,20 @@ function FeatureGridView({
|
||||
/>
|
||||
</div>
|
||||
|
||||
{/* Mini grid */}
|
||||
<div className="grid grid-cols-2 md:grid-cols-4 gap-[var(--spacing-scale-012)] mt-[var(--spacing-scale-048)] lg:mt-0 lg:flex-grow lg:shrink-0">
|
||||
<div className="mt-[var(--spacing-scale-048)] grid grid-cols-2 grid-rows-[repeat(2,minmax(0,1fr))] gap-x-[12px] gap-y-[12px] max-md:min-h-[384px] md:grid-cols-4 md:grid-rows-1 md:min-h-0 lg:mt-0 lg:shrink-0 lg:flex-grow">
|
||||
{features.map((feature, index) => (
|
||||
<Mini
|
||||
key={index}
|
||||
backgroundColor={feature.backgroundColor}
|
||||
labelLine1={feature.labelLine1}
|
||||
labelLine2={feature.labelLine2}
|
||||
panelContent={feature.panelContent}
|
||||
ariaLabel={feature.ariaLabel}
|
||||
panelContent={feature.panelContent}
|
||||
panelWidth={feature.panelWidth}
|
||||
panelHeight={feature.panelHeight}
|
||||
panelImageClassName={feature.panelImageClassName}
|
||||
ariaLabel={feature.ariaLabel}
|
||||
href={feature.href}
|
||||
featureGridShell
|
||||
/>
|
||||
))}
|
||||
</div>
|
||||
|
||||
Reference in New Issue
Block a user