Skip to content

Commit 80f1cd5

Browse files
committed
components/ui/dropdown/DropDown.astro: add name property to group dropdowns
implemtned on the core downloads page so when one dropdown is opened any others open will close
1 parent 2c8807f commit 80f1cd5

3 files changed

Lines changed: 11 additions & 3 deletions

File tree

src/components/pages/downloads/CoreCard.astro

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@ interface Props {
3232
releaseNotesUrl?: string;
3333
torrentUrl?: string;
3434
magnetUrl?: string;
35+
dropdownGroup?: string;
3536
}
3637
3738
const {
@@ -47,6 +48,7 @@ const {
4748
releaseNotesUrl,
4849
torrentUrl,
4950
magnetUrl,
51+
dropdownGroup,
5052
...rest
5153
} = Astro.props;
5254
const { t, safeMarkdown } = Astro.locals;
@@ -82,7 +84,10 @@ const PLATFORM_ICONS: Record<string, ImageMetadata> = {
8284
</ul>
8385
<div class="card-footer">
8486
<div class="download-actions">
85-
<Dropdown label={t("downloads:core.downloadButton")}>
87+
<Dropdown
88+
label={t("downloads:core.downloadButton")}
89+
name={dropdownGroup}
90+
>
8691
{
8792
downloads.map((item) =>
8893
item === "separator" ? (

src/components/ui/dropdown/Dropdown.astro

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,12 @@ import { icons } from "@/utils/icons";
55
66
interface Props {
77
label?: string;
8+
name?: string;
89
}
9-
const { label } = Astro.props;
10+
const { label, name } = Astro.props;
1011
---
1112

12-
<details class="dropdown">
13+
<details class="dropdown" name={name}>
1314
<summary class="dropdown-summary">
1415
<slot name="trigger">
1516
<Button variant="primary" as="span">

src/pages/downloads/index.astro

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,7 @@ const tabs = [
6969
>,
7070
)}
7171
downloads={coreDownloads.gui.downloads as DownloadLink[]}
72+
dropdownGroup="downloads"
7273
/>
7374

7475
<!-- Monero CLI Card -->
@@ -90,6 +91,7 @@ const tabs = [
9091
>,
9192
)}
9293
downloads={coreDownloads.cli.downloads as DownloadLink[]}
94+
dropdownGroup="downloads"
9395
/>
9496
</Grid>
9597

0 commit comments

Comments
 (0)