From 24ae5dc3e206b198e8513717eae57ef935457f5e Mon Sep 17 00:00:00 2001 From: Emil Gulamov <125820963+mearashadowfax@users.noreply.github.com> Date: Fri, 22 Mar 2024 04:43:44 +0400 Subject: [PATCH] Replace SVG icons with Icon component throughout the application A centralized Icon component is now used to manage all SVG icons, improving code readability and maintainability. It also replaced manually defined SVG paths in various components including cards, buttons, and sections. --- .../sections/pricing/PricingSection.astro | 25 ++-------- src/components/ui/blocks/AccordionItem.astro | 35 ++++---------- src/components/ui/blocks/StatsGrid.astro | 21 ++------- src/components/ui/buttons/Bookmark.astro | 19 ++------ src/components/ui/buttons/Btn404.astro | 18 +------ src/components/ui/buttons/GithubBtn.astro | 17 +------ src/components/ui/buttons/PrimaryCTA.astro | 18 +------ src/components/ui/buttons/SocialShare.astro | 47 +++---------------- src/components/ui/cards/CardInsight.astro | 14 +----- src/components/ui/cards/CardSmall.astro | 8 +--- src/components/ui/cards/CardWide.astro | 8 +--- 11 files changed, 37 insertions(+), 193 deletions(-) diff --git a/src/components/sections/pricing/PricingSection.astro b/src/components/sections/pricing/PricingSection.astro index 5eb1f96..8e66c78 100644 --- a/src/components/sections/pricing/PricingSection.astro +++ b/src/components/sections/pricing/PricingSection.astro @@ -1,6 +1,7 @@ --- // Import SecondaryCTA component for use in this module import SecondaryCTA from "../../ui/buttons/SecondaryCTA.astro"; +import Icon from "../../ui/icons/Icon.astro"; // Set heading and sub-heading for the pricing section const title: string = "Simple, Transparent Pricing"; @@ -94,17 +95,7 @@ const professionalToolbox: Product = { { starterKit.features.map((feature) => (
  • - - - + {feature}
  • @@ -154,17 +145,7 @@ const professionalToolbox: Product = { { professionalToolbox.features.map((feature) => (
  • - - - + {feature}
  • diff --git a/src/components/ui/blocks/AccordionItem.astro b/src/components/ui/blocks/AccordionItem.astro index e94dac2..04d04ec 100644 --- a/src/components/ui/blocks/AccordionItem.astro +++ b/src/components/ui/blocks/AccordionItem.astro @@ -1,12 +1,13 @@ --- +import Icon from "../icons/Icon.astro"; // Define props from Astro -const { id, collapseId, heading, content, first } = Astro.props; +const { id, collapseId, question, answer, first } = Astro.props; // Define TypeScript interface for props interface Props { id: string; collapseId: string; - heading: string; - content: string; + question: string; + answer: string; first?: boolean; } // Define class names for the accordion and its content @@ -27,32 +28,12 @@ function getAccordionClass(first: boolean = false) { class="hs-accordion-toggle group inline-flex w-full items-center justify-between gap-x-3 text-balance rounded-lg pb-3 text-start font-bold text-neutral-800 outline-none ring-zinc-500 transition hover:text-neutral-500 focus-visible:ring dark:text-neutral-200 dark:ring-zinc-200 dark:hover:text-neutral-400 dark:focus:outline-none md:text-lg" aria-controls={collapseId} > - {heading} + {question} - + - +

    - {content} + {answer}

    diff --git a/src/components/ui/blocks/StatsGrid.astro b/src/components/ui/blocks/StatsGrid.astro index 4fb12ff..c8446ff 100644 --- a/src/components/ui/blocks/StatsGrid.astro +++ b/src/components/ui/blocks/StatsGrid.astro @@ -1,4 +1,6 @@ --- +import Icon from "../icons/Icon.astro"; + const { count, description, index } = Astro.props; interface Props { @@ -12,24 +14,7 @@ interface Props {
    - { - index === 1 || index === 2 ? ( - - - - - ) : null - } + {index === 1 || index === 2 ? : null} {count}

    diff --git a/src/components/ui/buttons/Bookmark.astro b/src/components/ui/buttons/Bookmark.astro index 0c8ae2c..5265406 100644 --- a/src/components/ui/buttons/Bookmark.astro +++ b/src/components/ui/buttons/Bookmark.astro @@ -1,22 +1,13 @@ +--- +import Icon from "../icons/Icon.astro"; +--- +