From 539837b6d963394ec999c002292b59155091b90d Mon Sep 17 00:00:00 2001 From: Emil Gulamov <125820963+mearashadowfax@users.noreply.github.com> Date: Thu, 15 Feb 2024 10:06:55 +0400 Subject: [PATCH] Improve code readability and simplicity Condensed the code by breaking down long lines into multiple lines and removing unneeded classes in several UI components. The changes enhance readability, declutter the codebase, and result in a more accessible and maintainable code structure. --- src/components/ui/blocks/AccordionItem.astro | 22 ++++++++----------- .../ui/blocks/ContactIconBlock.astro | 17 +++----------- src/components/ui/blocks/IconBlock.astro | 12 +++++----- src/components/ui/images/ImgSmall.astro | 2 +- src/components/ui/images/ImgWide.astro | 2 +- 5 files changed, 20 insertions(+), 35 deletions(-) diff --git a/src/components/ui/blocks/AccordionItem.astro b/src/components/ui/blocks/AccordionItem.astro index a2250f2..5dba715 100644 --- a/src/components/ui/blocks/AccordionItem.astro +++ b/src/components/ui/blocks/AccordionItem.astro @@ -10,7 +10,8 @@ interface Props { } const ACCORDION_CLASS_DEFAULT = "hs-accordion pb-3 active"; const ACCORDION_CLASS_COLLAPSED = "hs-accordion pt-6 pb-3"; -const ACCORDION_CONTENT_CLASS = "hs-accordion-content w-full overflow-hidden transition-[height] duration-300"; +const ACCORDION_CONTENT_CLASS = + "hs-accordion-content w-full overflow-hidden transition-[height] duration-300"; function getAccordionClass(first: boolean = false) { return first ? ACCORDION_CLASS_DEFAULT : ACCORDION_CLASS_COLLAPSED; } @@ -22,14 +23,11 @@ const SVG_PARAMS = { stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", - strokeLinejoin: "round" + strokeLinejoin: "round", }; --- -
+

{content} diff --git a/src/components/ui/blocks/ContactIconBlock.astro b/src/components/ui/blocks/ContactIconBlock.astro index 8e9e3fc..0114e56 100644 --- a/src/components/ui/blocks/ContactIconBlock.astro +++ b/src/components/ui/blocks/ContactIconBlock.astro @@ -23,17 +23,8 @@ interface Props { const arrowSVG: string = ` - - ` +fill="none" viewBox="0 0 24 24" stroke-width="1.5" stroke="currentColor" > + `; ---

@@ -55,9 +46,7 @@ d="M13.5 4.5 21 12m0 0-7.5 7.5M21 12H3" href={linkURL} > {linkTitle} - {isArrowVisible ? - - : null} + {isArrowVisible ? : null} ) : null } diff --git a/src/components/ui/blocks/IconBlock.astro b/src/components/ui/blocks/IconBlock.astro index 76a81f6..3a97462 100644 --- a/src/components/ui/blocks/IconBlock.astro +++ b/src/components/ui/blocks/IconBlock.astro @@ -6,18 +6,18 @@ interface Props { content?: string; } -const headingClasses = "text-balance text-lg font-bold text-gray-800 dark:text-neutral-200"; -const contentClasses = "mt-1 text-pretty text-neutral-700 dark:text-neutral-300"; +const headingClasses = + "text-balance text-lg font-bold text-gray-800 dark:text-neutral-200"; +const contentClasses = + "mt-1 text-pretty text-neutral-700 dark:text-neutral-300"; ---
-

+

{heading}

-

{content} -

+

{content}

diff --git a/src/components/ui/images/ImgSmall.astro b/src/components/ui/images/ImgSmall.astro index 0149ffd..60f50f3 100644 --- a/src/components/ui/images/ImgSmall.astro +++ b/src/components/ui/images/ImgSmall.astro @@ -29,7 +29,7 @@ const AnchorSVG = ` />
diff --git a/src/components/ui/images/ImgWide.astro b/src/components/ui/images/ImgWide.astro index 825a303..70abcf8 100644 --- a/src/components/ui/images/ImgWide.astro +++ b/src/components/ui/images/ImgWide.astro @@ -28,7 +28,7 @@ const AnchorSVG = ` />