From 6e79bb51b9066b14872d052e8807b52017b3cadc Mon Sep 17 00:00:00 2001 From: thororen1234 <78185467+thororen1234@users.noreply.github.com> Date: Sat, 7 Jun 2025 12:01:12 -0400 Subject: [PATCH] Temp Fix Better Folders --- .../wallpaperFree/components/ctxmenu.tsx | 22 ++---- .../wallpaperFree/components/modal.tsx | 70 +++---------------- .../wallpaperFree/components/util.tsx | 37 ++-------- src/equicordplugins/wallpaperFree/index.tsx | 66 +++++++---------- src/equicordplugins/wallpaperFree/styles.css | 36 ++-------- src/plugins/betterFolders/index.tsx | 13 +--- 6 files changed, 54 insertions(+), 190 deletions(-) diff --git a/src/equicordplugins/wallpaperFree/components/ctxmenu.tsx b/src/equicordplugins/wallpaperFree/components/ctxmenu.tsx index a2fe4e8a..6ce575d0 100644 --- a/src/equicordplugins/wallpaperFree/components/ctxmenu.tsx +++ b/src/equicordplugins/wallpaperFree/components/ctxmenu.tsx @@ -8,8 +8,7 @@ import { NavContextMenuPatchCallback } from "@api/ContextMenu"; import { openModal } from "@utils/modal"; import { ChannelStore, FluxDispatcher, Menu } from "@webpack/common"; -import { SetCustomWallpaperModal, SetDiscordWallpaperModal } from "./modal"; -import { ChatWallpaperStore, fetchWallpapers } from "./util"; +import { SetWallpaperModal } from "./modal"; const addWallpaperMenu = (channelId?: string, guildId?: string) => { @@ -22,25 +21,18 @@ const addWallpaperMenu = (channelId?: string, guildId?: string) => { url, }); }; + return ( openModal(props => )} - /> - { - ChatWallpaperStore.shouldFetchWallpapers && await fetchWallpapers(); - openModal(props => ); - }} + label="Set Wallpaper" + id="vc-wpfree-set-wallpaper" + action={() => openModal(props => )} /> setWallpaper(void 0)} /> diff --git a/src/equicordplugins/wallpaperFree/components/modal.tsx b/src/equicordplugins/wallpaperFree/components/modal.tsx index 1faa3305..69c45a8d 100644 --- a/src/equicordplugins/wallpaperFree/components/modal.tsx +++ b/src/equicordplugins/wallpaperFree/components/modal.tsx @@ -5,38 +5,37 @@ */ import { ModalContent, ModalHeader, ModalProps, ModalRoot, ModalSize } from "@utils/modal"; -import { Button, lodash, Text, TextInput, useState, useStateFromStores } from "@webpack/common"; - -import { ChatWallpaperStore, Wallpaper } from "./util"; +import { Button, Text, TextInput, useState } from "@webpack/common"; interface Props { props: ModalProps; onSelect: (url: string) => void; } -export function SetCustomWallpaperModal({ props, onSelect }: Props) { +export function SetWallpaperModal({ props, onSelect }: Props) { const [url, setUrl] = useState(""); return ( - Set a custom wallpaper + Set wallpaper
- + The image url { + setUrl(u); + }} autoFocus /> {url && (
-
+ ); } - -export function SetDiscordWallpaperModal({ props, onSelect }: Props) { - const discordWallpapers: Wallpaper[] = useStateFromStores([ChatWallpaperStore], () => ChatWallpaperStore.wallpapers); - - return ( - - - - Choose a Discord Wallpaper - - - -
- {lodash.chunk(discordWallpapers, 2).map(group => { - const main = group[0]; - return ( -
-
- {main.label} -
- {main.label} -
-
-
- {group.map(wp => ( - - ))} -
-
- ); - })} -
-
-
- ); -} - diff --git a/src/equicordplugins/wallpaperFree/components/util.tsx b/src/equicordplugins/wallpaperFree/components/util.tsx index 763d8882..6d8bba8f 100644 --- a/src/equicordplugins/wallpaperFree/components/util.tsx +++ b/src/equicordplugins/wallpaperFree/components/util.tsx @@ -6,13 +6,9 @@ import { openModal } from "@utils/modal"; import { makeCodeblock } from "@utils/text"; -import { findByCodeLazy, findStoreLazy } from "@webpack"; import { Button, FluxDispatcher, Parser } from "@webpack/common"; -import { SetCustomWallpaperModal, SetDiscordWallpaperModal } from "./modal"; - -export const ChatWallpaperStore = findStoreLazy("ChatWallpaperStore"); -export const fetchWallpapers = findByCodeLazy('type:"FETCH_CHAT_WALLPAPERS_SUCCESS"'); +import { SetWallpaperModal } from "./modal"; export function GlobalDefaultComponent() { const setGlobal = (url?: string) => { @@ -26,13 +22,8 @@ export function GlobalDefaultComponent() { return ( <> - - + openModal(props => ); + }}>Set a global wallpaper