From 8d43521b45a78b5c61a4fe2fe7e3982846fafc24 Mon Sep 17 00:00:00 2001 From: Emil Gulamov <125820963+mearashadowfax@users.noreply.github.com> Date: Sun, 18 Feb 2024 07:41:36 +0400 Subject: [PATCH] Refactor multiple components, enhance comments, and rename Refactored multiple Astro UI components, including sections, buttons, and modals, with a focus on code cleanliness and efficiency. This included revising import statements, reordering and redefining CSS classes, and updating HTML elements. Enhanced inline comments to add context and explanations, especially registering the purpose of components and properties for improved understanding. The Accordion-related functionality was removed, pointing towards a redesign of its element usage. Moreover, TestimonialsSection2 was renamed to TestimonialsSectionAlt for better semantics. --- src/components/PricingSection.astro | 19 ++++---- src/components/ui/blocks/RightSection.astro | 14 ++++-- src/components/ui/buttons/PrimaryCTA.astro | 34 ++++++++------ src/components/ui/buttons/ProductTabBtn.astro | 27 ++++++----- src/components/ui/buttons/SecondaryCTA.astro | 26 +++++++---- src/components/ui/forms/RecoverModal.astro | 33 +++++++------- src/components/ui/forms/RegisterModal.astro | 43 +++++++++--------- src/images/product-image-1.avif | Bin 52757 -> 37593 bytes src/images/product-image-2.avif | Bin 50307 -> 23584 bytes src/images/product-image-3.avif | Bin 80464 -> 38009 bytes src/images/product-image-4.avif | Bin 70715 -> 29856 bytes src/images/product-image-main-1.avif | Bin 53282 -> 55585 bytes src/images/product-image-main-2.avif | Bin 50963 -> 35635 bytes src/images/product-image-main-3.avif | Bin 53954 -> 56693 bytes src/images/product-image-main-4.avif | Bin 70237 -> 46199 bytes src/pages/services.astro | 21 +++++++-- 16 files changed, 124 insertions(+), 93 deletions(-) diff --git a/src/components/PricingSection.astro b/src/components/PricingSection.astro index 633c345..69c21e7 100644 --- a/src/components/PricingSection.astro +++ b/src/components/PricingSection.astro @@ -1,16 +1,13 @@ --- -// Import the necessary dependencies from individual component files +// Import SecondaryCTA component for use in this module import SecondaryCTA from "./ui/buttons/SecondaryCTA.astro"; -// Variables for customization of the LoginModal Component -// Main heading +// Set heading and sub-heading for the pricing section const title: string = "Simple, Transparent Pricing"; - -// Sub-heading text const subTitle: string = "Boost efficiency with ScrewFast's clear, value-driven plans."; -/* TypeScript type for product. */ +// Define TypeScript type for products. type Product = { name: string; description: string; @@ -21,7 +18,7 @@ type Product = { purchaseBtnTitle: string; purchaseLink: string; }; - +// Define two products for display - Starter Kit and Professional Toolbox. const starterKit: Product = { name: "Starter Kit", description: "Best option for DIY projects", @@ -57,7 +54,7 @@ const professionalToolbox: Product = {
Enterprise Solutions?
diff --git a/src/components/ui/blocks/RightSection.astro b/src/components/ui/blocks/RightSection.astro
index db6a8e1..d9bab0f 100644
--- a/src/components/ui/blocks/RightSection.astro
+++ b/src/components/ui/blocks/RightSection.astro
@@ -1,7 +1,8 @@
---
+// Import the required modules
import { Image } from "astro:assets";
import PrimaryCTA from "../buttons/PrimaryCTA.astro";
-
+// Extract properties from Astro.props
const {
title,
subTitle,
@@ -14,7 +15,7 @@ const {
imgTwo,
imgTwoAlt,
} = Astro.props;
-
+// Define TypeScript interface for the properties
interface Props {
title: string;
subTitle: string;
@@ -28,26 +29,31 @@ interface Props {
imgTwoAlt?: any;
}
---
-
+
{subTitle}
{title}
+