/* * Vesktop, a desktop app aiming to give you a snappier Discord Experience * Copyright (c) 2025 Vendicated and Vencord contributors * SPDX-License-Identifier: GPL-3.0-or-later */ import "./UserAssets.css"; import { ModalCloseButton, ModalContent, ModalHeader, ModalRoot, ModalSize, openModal, wordsFromCamel, wordsToTitle } from "@vencord/types/utils"; import { Button, showToast, Text, useState } from "@vencord/types/webpack/common"; import { UserAssetType } from "main/userAssets"; import { SettingsComponent } from "./Settings"; const CUSTOMIZABLE_ASSETS: UserAssetType[] = ["splash", "tray", "trayUnread"]; export const UserAssetsButton: SettingsComponent = () => { return openAssetsModal()}>Customize App Assets; }; function openAssetsModal() { openModal(props => ( User Assets {CUSTOMIZABLE_ASSETS.map(asset => ( ))} )); } function Asset({ asset }: { asset: UserAssetType }) { // cache busting const [version, setVersion] = useState(Date.now()); const onChooseAsset = (value?: null) => async () => { const res = await VesktopNative.fileManager.chooseUserAsset(asset, value); if (res === "ok") { setVersion(Date.now()); } else if (res === "failed") { showToast("Something went wrong. Please try again"); } }; return ( {wordsToTitle(wordsFromCamel(asset))} Customize Reset to default ); }