Cleanup assets
This commit is contained in:
@@ -2,6 +2,7 @@
|
||||
|
||||
import { memo } from "react";
|
||||
import {
|
||||
ASSETS,
|
||||
getAssetPath,
|
||||
contentBlogHorizontalPath,
|
||||
contentBlogSectionPath,
|
||||
@@ -36,7 +37,7 @@ const ContentBannerContainer = memo<ContentBannerProps>(
|
||||
return contentBlogHorizontalPath(blogPost.slug);
|
||||
}
|
||||
|
||||
return getAssetPath("assets/Content_Banner.svg");
|
||||
return getAssetPath(ASSETS.CONTENT_BANNER);
|
||||
};
|
||||
|
||||
const resolveSectionImage = (blogPost: BlogPost): string => {
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
"use client";
|
||||
|
||||
import { memo, useMemo } from "react";
|
||||
import { getAssetPath, featurePanelPath } from "../../../../lib/assetUtils";
|
||||
import { useTranslation } from "../../../contexts/MessagesContext";
|
||||
import FeatureGridView from "./FeatureGrid.view";
|
||||
import type { FeatureGridProps, Feature } from "./FeatureGrid.types";
|
||||
@@ -19,7 +20,7 @@ const FeatureGridContainer = memo<FeatureGridProps>(
|
||||
labelLine2: t(
|
||||
"pages.home.featureGrid.features.decisionMaking.labelLine2",
|
||||
),
|
||||
panelContent: "/assets/Feature_Support.png",
|
||||
panelContent: getAssetPath(featurePanelPath("support")),
|
||||
ariaLabel: t("featureGrid.features.decisionMaking.ariaLabel"),
|
||||
href: "#decision-making",
|
||||
},
|
||||
@@ -31,7 +32,7 @@ const FeatureGridContainer = memo<FeatureGridProps>(
|
||||
labelLine2: t(
|
||||
"pages.home.featureGrid.features.valuesAlignment.labelLine2",
|
||||
),
|
||||
panelContent: "/assets/Feature_Exercises.png",
|
||||
panelContent: getAssetPath(featurePanelPath("exercises")),
|
||||
ariaLabel: t("featureGrid.features.valuesAlignment.ariaLabel"),
|
||||
href: "#values-alignment",
|
||||
},
|
||||
@@ -43,7 +44,7 @@ const FeatureGridContainer = memo<FeatureGridProps>(
|
||||
labelLine2: t(
|
||||
"pages.home.featureGrid.features.membershipGuidance.labelLine2",
|
||||
),
|
||||
panelContent: "/assets/Feature_Guidance.png",
|
||||
panelContent: getAssetPath(featurePanelPath("guidance")),
|
||||
ariaLabel: t("featureGrid.features.membershipGuidance.ariaLabel"),
|
||||
href: "#membership-guidance",
|
||||
},
|
||||
@@ -55,7 +56,7 @@ const FeatureGridContainer = memo<FeatureGridProps>(
|
||||
labelLine2: t(
|
||||
"pages.home.featureGrid.features.conflictResolution.labelLine2",
|
||||
),
|
||||
panelContent: "/assets/Feature_Tools.png",
|
||||
panelContent: getAssetPath(featurePanelPath("tools")),
|
||||
ariaLabel: t("featureGrid.features.conflictResolution.ariaLabel"),
|
||||
href: "#conflict-resolution",
|
||||
},
|
||||
|
||||
@@ -4,7 +4,7 @@ import { memo } from "react";
|
||||
import { useTranslation } from "../../../contexts/MessagesContext";
|
||||
import ContentLockup from "../../type/ContentLockup";
|
||||
import HeroDecor from "./HeroDecor";
|
||||
import { getAssetPath } from "../../../../lib/assetUtils";
|
||||
import { ASSETS, getAssetPath } from "../../../../lib/assetUtils";
|
||||
|
||||
interface HeroBannerProps {
|
||||
title?: string;
|
||||
@@ -48,7 +48,7 @@ const HeroBanner = memo<HeroBannerProps>(
|
||||
<div className="w-full h-full md:flex-1 rounded-[8px] overflow-hidden relative z-10 flex items-center justify-center">
|
||||
{/* eslint-disable-next-line @next/next/no-img-element -- dynamic path from getAssetPath */}
|
||||
<img
|
||||
src={getAssetPath("assets/HeroImage.png")}
|
||||
src={getAssetPath(ASSETS.HERO_IMAGE)}
|
||||
alt={imageAlt}
|
||||
className="w-full h-auto"
|
||||
loading="eager"
|
||||
|
||||
@@ -1,42 +1,43 @@
|
||||
"use client";
|
||||
|
||||
import { memo, useState, useEffect, useMemo } from "react";
|
||||
import { getAssetPath, partnerLogoPath } from "../../../../lib/assetUtils";
|
||||
import LogoWallView from "./LogoWall.view";
|
||||
import type { LogoWallProps } from "./LogoWall.types";
|
||||
|
||||
const defaultLogos = [
|
||||
{
|
||||
src: "/assets/Section/Logo_FoodNotBombs.png",
|
||||
src: getAssetPath(partnerLogoPath("food-not-bombs")),
|
||||
alt: "Food Not Bombs",
|
||||
size: "h-11 lg:h-14 xl:h-[70px]",
|
||||
order: "order-1 sm:order-4", // Mobile: row 1 col 1, SM: row 2 col 1 (bottom left)
|
||||
},
|
||||
{
|
||||
src: "/assets/Section/Logo_StartCOOP.png",
|
||||
src: getAssetPath(partnerLogoPath("start-coop")),
|
||||
alt: "Start COOP",
|
||||
size: "h-[42px] lg:h-[53px] xl:h-[66px]",
|
||||
order: "order-2 sm:order-2", // Mobile: row 1 col 2, SM: row 1 col 2 (top middle)
|
||||
},
|
||||
{
|
||||
src: "/assets/Section/Logo_Metagov.png",
|
||||
src: getAssetPath(partnerLogoPath("metagov")),
|
||||
alt: "Metagov",
|
||||
size: "h-6 lg:h-8 xl:h-[41px]",
|
||||
order: "order-3 sm:order-1", // Mobile: row 2 col 1, SM: row 1 col 1 (top left)
|
||||
},
|
||||
{
|
||||
src: "/assets/Section/Logo_OpenCivics.png",
|
||||
src: getAssetPath(partnerLogoPath("open-civics")),
|
||||
alt: "Open Civics",
|
||||
size: "h-8 lg:h-10 xl:h-[50px]",
|
||||
order: "order-4 sm:order-5 md:order-6", // Mobile: row 2 col 2, SM: row 2 col 2, MD: swapped with Mutual Aid CO
|
||||
},
|
||||
{
|
||||
src: "/assets/Section/Logo_MutualAidCO.png",
|
||||
src: getAssetPath(partnerLogoPath("mutual-aid-co")),
|
||||
alt: "Mutual Aid CO",
|
||||
size: "h-11 lg:h-14 xl:h-[70px]",
|
||||
order: "order-5 sm:order-6 md:order-5", // Mobile: row 3 col 1, SM: row 2 col 3, MD: swapped with OpenCivics
|
||||
},
|
||||
{
|
||||
src: "/assets/Section/Logo_CUBoulder.png",
|
||||
src: getAssetPath(partnerLogoPath("cu-boulder")),
|
||||
alt: "CU Boulder",
|
||||
size: "h-10 lg:h-12 xl:h-[60px]",
|
||||
order: "order-6 sm:order-3", // Mobile: row 3 col 2, SM: row 1 col 3 (top right)
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
"use client";
|
||||
|
||||
import { memo, useState } from "react";
|
||||
import { ASSETS, getAssetPath } from "../../../../lib/assetUtils";
|
||||
import { logger } from "../../../../lib/logger";
|
||||
import QuoteBlockView from "./QuoteBlock.view";
|
||||
import type { QuoteBlockProps, VariantConfig } from "./QuoteBlock.types";
|
||||
@@ -14,9 +15,9 @@ const QuoteBlockContainer = memo<QuoteBlockProps>(
|
||||
quoteSecondary,
|
||||
author = "Jo Freeman",
|
||||
source = "The Tyranny of Structurelessness",
|
||||
avatarSrc = "/assets/Quote_Avatar.svg",
|
||||
avatarSrc = getAssetPath(ASSETS.QUOTE_AVATAR),
|
||||
id,
|
||||
fallbackAvatarSrc = "/assets/Quote_Avatar.svg",
|
||||
fallbackAvatarSrc = getAssetPath(ASSETS.QUOTE_AVATAR),
|
||||
onError,
|
||||
}) => {
|
||||
const [imageError, setImageError] = useState(false);
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
"use client";
|
||||
|
||||
import { memo } from "react";
|
||||
import { getAssetPath } from "../../../lib/assetUtils";
|
||||
import { getAssetPath, sectionNumberPath } from "../../../lib/assetUtils";
|
||||
|
||||
interface SectionNumberProps {
|
||||
number: number;
|
||||
@@ -9,19 +9,8 @@ interface SectionNumberProps {
|
||||
|
||||
const SectionNumber = memo<SectionNumberProps>(({ number }) => {
|
||||
const getImageSrc = (num: number): string => {
|
||||
const assetPath = (() => {
|
||||
switch (num) {
|
||||
case 1:
|
||||
return "assets/SectionNumber_1.png";
|
||||
case 2:
|
||||
return "assets/SectionNumber_2.png";
|
||||
case 3:
|
||||
return "assets/SectionNumber_3.png";
|
||||
default:
|
||||
return "assets/SectionNumber_1.png";
|
||||
}
|
||||
})();
|
||||
return getAssetPath(assetPath);
|
||||
const n = num === 2 || num === 3 ? num : 1;
|
||||
return getAssetPath(sectionNumberPath(n));
|
||||
};
|
||||
|
||||
return (
|
||||
|
||||
Reference in New Issue
Block a user