Skip to content

Commit

Permalink
refactor: use class list
Browse files Browse the repository at this point in the history
Signed-off-by: Adam Setch <[email protected]>
  • Loading branch information
setchy committed Nov 17, 2024
1 parent 814e897 commit 7f9f4a3
Show file tree
Hide file tree
Showing 3 changed files with 27 additions and 18 deletions.
7 changes: 4 additions & 3 deletions src/components/Footer.astro
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,10 @@ const isHomepage = currentPathname === "/";
---

<div
class={`bg-gray-800 text-white text-sm py-10 px-3 ${
isHomepage ? 'mt-0' : 'mt-12'
}`}
class:list={[
"bg-gray-800 text-white text-sm py-10 px-3",
isHomepage ? "mt-0" : "mt-12",
]}
>
<div class="container mx-auto flex flex-col items-center text-center">
<a
Expand Down
28 changes: 17 additions & 11 deletions src/components/LatestRelease.astro
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,11 @@ const { downloadLinks, version, releaseDate } = await loadInitialData();
{downloadLinks.primary.map((item) => (
<a
href={item.url}
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`}
class:list={[
"flex items-center mb-3 px-4 py-3 mr-4",
"font-semibold text-white hover:text-white",
"rounded-md bg-green-700 hover:bg-green-800 ",
]}
>
<div class="flex flex-row gap-2 items-center">
<Icon name="line-md:cloud-alt-download-filled" size={24} />
Expand All @@ -115,20 +119,22 @@ const { downloadLinks, version, releaseDate } = await loadInitialData();
))}
</div>
<div class="w-80">
<p>Latest version: <a href={URLs.GITHUB.LATEST_RELEASE}>{version}</a></p>
<p>
Latest version: <a href={URLs.GITHUB.LATEST_RELEASE}>{version}</a>
</p>
<p class="mt-1">Released on: {releaseDate}</p>
{downloadLinks.alt.length > 0 && (
<p class="mt-1">
Also available on:
<ul class="list-disc list-inside ml-4">
{downloadLinks.alt.map((platform) => (
<li>
<a href={platform.url || URLs.GITHUB.LATEST_RELEASE}>
{platform.name}
</a>
</li>
))}
</ul>
<ul class="list-disc list-inside ml-4">
{downloadLinks.alt.map((platform) => (
<li>
<a href={platform.url || URLs.GITHUB.LATEST_RELEASE}>
{platform.name}
</a>
</li>
))}
</ul>
</p>
)}
</div>
Expand Down
10 changes: 6 additions & 4 deletions src/components/Navbar.astro
Original file line number Diff line number Diff line change
Expand Up @@ -25,11 +25,13 @@ const isHomepage = currentPathname === "/";
<li>
<a
href={item.path}
class={`py-1.5 lg:py-2 px-2 lg:px-3 font-light ${
class:list={[
"py-1.5 lg:py-2 px-2 lg:px-3",
"text-white font-light hover:text-gray-300",
currentPathname === item.path
? "border rounded-lg border-white text-white"
: "text-white"
} hover:text-gray-300`}
: "",
]}
>
{item.name}
</a>
Expand All @@ -39,7 +41,7 @@ const isHomepage = currentPathname === "/";

<li>
<GitHubRepo />
</li>
</li>
</ul>
</div>
</div>
Expand Down

0 comments on commit 7f9f4a3

Please sign in to comment.