Skip to content

Commit 7f9f4a3

Browse files
committed
refactor: use class list
Signed-off-by: Adam Setch <adam.setch@outlook.com>
1 parent 814e897 commit 7f9f4a3

File tree

3 files changed

+27
-18
lines changed

3 files changed

+27
-18
lines changed

src/components/Footer.astro

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,10 @@ const isHomepage = currentPathname === "/";
88
---
99

1010
<div
11-
class={`bg-gray-800 text-white text-sm py-10 px-3 ${
12-
isHomepage ? 'mt-0' : 'mt-12'
13-
}`}
11+
class:list={[
12+
"bg-gray-800 text-white text-sm py-10 px-3",
13+
isHomepage ? "mt-0" : "mt-12",
14+
]}
1415
>
1516
<div class="container mx-auto flex flex-col items-center text-center">
1617
<a

src/components/LatestRelease.astro

Lines changed: 17 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,11 @@ const { downloadLinks, version, releaseDate } = await loadInitialData();
105105
{downloadLinks.primary.map((item) => (
106106
<a
107107
href={item.url}
108-
class={`flex items-center mb-3 px-4 py-3 font-semibold text-white rounded-md bg-green-700 hover:bg-green-800 hover:text-white mr-4`}
108+
class:list={[
109+
"flex items-center mb-3 px-4 py-3 mr-4",
110+
"font-semibold text-white hover:text-white",
111+
"rounded-md bg-green-700 hover:bg-green-800 ",
112+
]}
109113
>
110114
<div class="flex flex-row gap-2 items-center">
111115
<Icon name="line-md:cloud-alt-download-filled" size={24} />
@@ -115,20 +119,22 @@ const { downloadLinks, version, releaseDate } = await loadInitialData();
115119
))}
116120
</div>
117121
<div class="w-80">
118-
<p>Latest version: <a href={URLs.GITHUB.LATEST_RELEASE}>{version}</a></p>
122+
<p>
123+
Latest version: <a href={URLs.GITHUB.LATEST_RELEASE}>{version}</a>
124+
</p>
119125
<p class="mt-1">Released on: {releaseDate}</p>
120126
{downloadLinks.alt.length > 0 && (
121127
<p class="mt-1">
122128
Also available on:
123-
<ul class="list-disc list-inside ml-4">
124-
{downloadLinks.alt.map((platform) => (
125-
<li>
126-
<a href={platform.url || URLs.GITHUB.LATEST_RELEASE}>
127-
{platform.name}
128-
</a>
129-
</li>
130-
))}
131-
</ul>
129+
<ul class="list-disc list-inside ml-4">
130+
{downloadLinks.alt.map((platform) => (
131+
<li>
132+
<a href={platform.url || URLs.GITHUB.LATEST_RELEASE}>
133+
{platform.name}
134+
</a>
135+
</li>
136+
))}
137+
</ul>
132138
</p>
133139
)}
134140
</div>

src/components/Navbar.astro

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -25,11 +25,13 @@ const isHomepage = currentPathname === "/";
2525
<li>
2626
<a
2727
href={item.path}
28-
class={`py-1.5 lg:py-2 px-2 lg:px-3 font-light ${
28+
class:list={[
29+
"py-1.5 lg:py-2 px-2 lg:px-3",
30+
"text-white font-light hover:text-gray-300",
2931
currentPathname === item.path
3032
? "border rounded-lg border-white text-white"
31-
: "text-white"
32-
} hover:text-gray-300`}
33+
: "",
34+
]}
3335
>
3436
{item.name}
3537
</a>
@@ -39,7 +41,7 @@ const isHomepage = currentPathname === "/";
3941

4042
<li>
4143
<GitHubRepo />
42-
</li>
44+
</li>
4345
</ul>
4446
</div>
4547
</div>

0 commit comments

Comments
 (0)