Merge pull request #29 from rotary-dev-fellowship/refactor/brandlogo-props

Refactor: Simplify BrandLogo Component Props Handling
This commit is contained in:
Emil Gulamov 2024-03-30 03:45:40 +04:00 committed by GitHub
commit 9566b4403f
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 7 additions and 11 deletions

View file

@ -1,12 +1,8 @@
---
const { width } = Astro.props;
interface Props {
width: string;
}
---
<svg class=`h-auto ${width}` viewBox="0 0 521 226" fill="none">
<svg
{...Astro.props}
viewBox="0 0 521 226"
fill="none"
>
<rect
width="78.937"
height="18.485"

Before

Width:  |  Height:  |  Size: 5.6 KiB

After

Width:  |  Height:  |  Size: 5.5 KiB

View file

@ -25,7 +25,7 @@ const crafted: string = Astro.currentLocale === "fr" ? "Fabriqué par" : "Crafte
<div class="grid grid-cols-2 gap-6 md:grid-cols-4 lg:grid-cols-5">
<div class="col-span-full lg:col-span-1">
<!-- Brand Logo -->
<BrandLogo width="w-32" />
<BrandLogo class="h-auto w-32" />
</div>
<!-- An array of links for Product and Company sections -->
{

View file

@ -29,7 +29,7 @@ const homeUrl = Astro.currentLocale === "fr" ? "/fr" : "/";
href={homeUrl}
aria-label="Brand"
>
<BrandLogo width="w-24" />
<BrandLogo class="h-auto w-24" />
</a>
<!-- Collapse toggle for smaller screens -->
<div class="ml-auto mr-5 md:hidden">