Skip to content

Commit 90d5431

Browse files
committed
Update anchorId to anchorSlug
1 parent 3cdec0b commit 90d5431

2 files changed

Lines changed: 8 additions & 8 deletions

File tree

components/ui/Accordion.tsx

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -31,8 +31,8 @@ type AccordionProps = {
3131
title: string;
3232
description?: string;
3333
defaultOpen?: boolean;
34-
/** When set, this value is used as the element `id` and the accordion opens if the URL hash matches (for deep links). */
35-
anchorId?: string;
34+
/** When set, this slug is used as the element `id` and the accordion opens if the URL hash matches (for deep links). Use a URL-safe hyphenated fragment, e.g. `my-section`. */
35+
anchorSlug?: string;
3636
};
3737

3838
// Helper function to parse title and split into text and code parts
@@ -81,25 +81,25 @@ const Accordion = ({
8181
title,
8282
description,
8383
defaultOpen = false,
84-
anchorId,
84+
anchorSlug,
8585
}: AccordionProps) => {
8686
const [open, setOpen] = useState<boolean>(defaultOpen);
8787
const titleParts = useMemo(() => parseTitleWithCode(title), [title]);
8888

8989
useLayoutEffect(() => {
90-
if (!anchorId) return;
90+
if (!anchorSlug) return;
9191
const syncFromHash = () => {
92-
if (getHashFragment() === anchorId) {
92+
if (getHashFragment() === anchorSlug) {
9393
setOpen(true);
9494
}
9595
};
9696
syncFromHash();
9797
window.addEventListener("hashchange", syncFromHash);
9898
return () => window.removeEventListener("hashchange", syncFromHash);
99-
}, [anchorId]);
99+
}, [anchorSlug]);
100100

101101
return (
102-
<Box role="listitem" id={anchorId}>
102+
<Box role="listitem" id={anchorSlug}>
103103
<MenuItem
104104
as="button"
105105
onClick={() => setOpen(!open)}

content/managing-recipients/setting-channel-data.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -241,7 +241,7 @@ The `PushDevice` object is used to optionally set device-level metadata for a pu
241241
| incoming_webhook.url | `string` | The Discord incoming webhook URL (to be used instead of the properties above) |
242242

243243
</Accordion>
244-
<Accordion title ="Microsoft Teams" anchorId="microsoft-teams-channel-data">
244+
<Accordion title ="Microsoft Teams" anchorSlug="microsoft-teams-channel-data">
245245
| Property | Type | Description |
246246
| ----------- | --------------------- | ---------------------------------- |
247247
| connections | `MsTeamsConnection[]` | One or more connections to MsTeams |

0 commit comments

Comments
 (0)