/* * SPDX-License-Identifier: GPL-3.0 * Vesktop, a desktop app aiming to give you a snappier Discord Experience * Copyright (c) 2023 Vendicated and Vencord contributors */ import { findByPropsLazy } from "@vencord/types/webpack"; import { Forms, Switch, Toasts } from "@vencord/types/webpack/common"; import { Settings } from "renderer/settings"; import { SettingsComponent } from "./Settings"; const { PencilIcon } = findByPropsLazy("PencilIcon"); export const TrayIconImagePicker: SettingsComponent = ({ settings }) => { return ( <>
(Settings.store.tray = v)} note={"Add a tray icon for Vesktop"} > Tray Icon
{ e.preventDefault(); settings.trayIconPath = void 0; }} > Reset
hello { const choice = await VesktopNative.fileManager.selectTrayIcon(); switch (choice) { case "cancelled": return; case "invalid": Toasts.show({ message: "Please select a valid .png or .jpg image!", id: Toasts.genId(), type: Toasts.Type.FAILURE }); return; } settings.trayIconPath = choice; }} />
); };