bump dependencies, migrate to new Vencord Switch component

This commit is contained in:
Vendicated
2025-10-07 00:37:45 +02:00
parent a55b1f0250
commit 8cc34e217c
9 changed files with 556 additions and 573 deletions

View File

@@ -14,14 +14,13 @@ export const AutoStartToggle: SettingsComponent = () => {
return (
<VesktopSettingsSwitch
title="Start With System"
description="Automatically start Vesktop on computer start-up"
value={autoStartEnabled}
onChange={async v => {
await VesktopNative.autostart[v ? "enable" : "disable"]();
setAutoStartEnabled(v);
}}
note="Automatically start Vesktop on computer start-up"
>
Start With System
</VesktopSettingsSwitch>
/>
);
};

View File

@@ -12,15 +12,14 @@ import { VesktopSettingsSwitch } from "./VesktopSettingsSwitch";
export const NotificationBadgeToggle: SettingsComponent = ({ settings }) => {
return (
<VesktopSettingsSwitch
title="Notification Badge"
description="Show mention badge on the app icon"
value={settings.appBadge ?? true}
onChange={v => {
settings.appBadge = v;
if (v) setBadge();
else VesktopNative.app.setBadgeCount(0);
}}
note="Show mention badge on the app icon"
>
Notification Badge
</VesktopSettingsSwitch>
/>
);
};

View File

@@ -158,14 +158,13 @@ function SettingsSections() {
return (
<VesktopSettingsSwitch
title={title}
description={description}
value={Settings[key as any] ?? defaultValue}
onChange={v => (Settings[key as any] = v)}
note={description}
disabled={disabled?.()}
key={key}
>
{title}
</VesktopSettingsSwitch>
/>
);
})}
</div>
@@ -181,8 +180,6 @@ export default ErrorBoundary.wrap(
function SettingsUI() {
return (
<Forms.FormSection>
{/* FIXME: Outdated type */}
{/* @ts-expect-error Outdated type */}
<Text variant="heading-xl/semibold" color="header-primary" className="vcd-settings-title">
Vesktop Settings
</Text>

View File

@@ -4,13 +4,9 @@
* SPDX-License-Identifier: GPL-3.0-or-later
*/
import { Switch } from "@vencord/types/webpack/common";
import { FormSwitch } from "@vencord/types/components";
import { ComponentProps } from "react";
export function VesktopSettingsSwitch(props: ComponentProps<typeof Switch>) {
return (
<Switch {...props} hideBorder className="vcd-settings-switch">
{props.children}
</Switch>
);
export function VesktopSettingsSwitch(props: ComponentProps<typeof FormSwitch>) {
return <FormSwitch {...props} hideBorder className="vcd-settings-switch" />;
}