refactor: improve code quality

This commit is contained in:
saicaca
2024-07-21 15:47:49 +08:00
parent 743d8dd9c2
commit 003c644146
20 changed files with 76 additions and 69 deletions

View File

@@ -4,9 +4,9 @@ interface Props {
url?: string
label?: string
}
const { badge, url, name } = Astro.props
const { badge, url, label } = Astro.props
---
<a href={url} aria-label={name}>
<a href={url} aria-label={label}>
<button
class:list={`
w-full

View File

@@ -59,7 +59,7 @@ const getPageUrl = (p: number) => {
---
<div class:list={[className, "flex flex-row gap-3 justify-center"]} style={style}>
<a href={url(page.url.prev)} aria-label={page.url.prev ? "Previous Page" : null}
<a href={url(page.url.prev || "")} aria-label={page.url.prev ? "Previous Page" : null}
class:list={["btn-card overflow-hidden rounded-lg text-[var(--primary)] w-11 h-11",
{"disabled": page.url.prev == undefined}
]}
@@ -81,7 +81,7 @@ const getPageUrl = (p: number) => {
>{p}</a>
})}
</div>
<a href={url(page.url.next)} aria-label={page.url.next ? "Next Page" : null}
<a href={url(page.url.next || "")} aria-label={page.url.next ? "Next Page" : null}
class:list={["btn-card overflow-hidden rounded-lg text-[var(--primary)] w-11 h-11",
{"disabled": page.url.next == undefined}
]}