/* * Vencord, a Discord client mod * Copyright (c) 2026 Evandro * SPDX-License-Identifier: GPL-3.0-or-later */ import { Button } from "@components/Button"; import { findByPropsLazy } from "@webpack"; import { i18n, SettingsRouter, useState, useStateFromStores } from "@webpack/common"; import { pickCopy } from "./copy"; import { KeybindsStore, portalActive } from "./discord"; function locale(): string { try { return i18n.intl.currentLocale ?? document.documentElement.lang; } catch { return document.documentElement.lang; } } // the panel renders inside the plugin modal, so the top of Discord's modal stack at mount is that modal const ModalStack = findByPropsLazy("getOpenModalKeys", "closeModal"); function topModalKey(): string | undefined { try { return [...ModalStack.getOpenModalKeys()].at(-1); } catch { return undefined; } } function openKeybinds(pluginModalKey: string | undefined) { // settings ignore navigation while another modal sits on top of them if (pluginModalKey) ModalStack.closeModal(pluginModalKey); SettingsRouter.openUserSettings("system_custom_keybinds_category"); } function StatusIcon({ active }: { active: boolean; }) { return ( ); } export function AboutPanel() { const copy = pickCopy(locale()); const active = portalActive(); const [modalKey] = useState(topModalKey); const registered = useStateFromStores([KeybindsStore], () => Object.keys(KeybindsStore.getUserAgnosticState() ?? {}) .filter(id => KeybindsStore.getWaylandPortalShortcutState(id)?.bound).length ); if (!active) { return (

{copy.inactive}

); } return (

{copy.active(registered)}

{copy.title}

{copy.lead}

{/* list-style is removed for the numbered badges, so keep the list role for screen readers */}
    {copy.steps.map(([before, bold, after], i) =>
  1. {before}{bold && {bold}}{after}
  2. )}

{copy.tip}

); }