From 2365b23fc704f73af0daa928b8d5f6a3288675cd Mon Sep 17 00:00:00 2001 From: thororen <78185467+thororen1234@users.noreply.github.com> Date: Sun, 21 Apr 2024 00:35:46 -0400 Subject: [PATCH] Lil Update 2 SoundBoardLogger --- .../soundBoardLogger/components/Icons.tsx | 11 +++++++++++ src/equicordplugins/soundBoardLogger/index.tsx | 17 ++++------------- 2 files changed, 15 insertions(+), 13 deletions(-) diff --git a/src/equicordplugins/soundBoardLogger/components/Icons.tsx b/src/equicordplugins/soundBoardLogger/components/Icons.tsx index 2eb645810..fe67ccfeb 100644 --- a/src/equicordplugins/soundBoardLogger/components/Icons.tsx +++ b/src/equicordplugins/soundBoardLogger/components/Icons.tsx @@ -4,10 +4,12 @@ * SPDX-License-Identifier: GPL-3.0-or-later */ +import { ChatBarButton } from "@api/ChatButtons"; import { classes } from "@utils/misc"; import { Button, ButtonLooks, ButtonWrapperClasses, Tooltip } from "@webpack/common"; import { cl } from "../utils"; +import { openSoundBoardLog } from "./SoundBoardLog"; // Thanks svgrepo.com for the play and download icons. // Licensed under CC Attribution License https://www.svgrepo.com/page/licensing/#CC%20Attribution @@ -55,3 +57,12 @@ export function IconWithTooltip({ text, icon, onClick }) { )} ; } + +export const ChatBarIcon: ChatBarButton = () => { + return ( + + + + ); +}; diff --git a/src/equicordplugins/soundBoardLogger/index.tsx b/src/equicordplugins/soundBoardLogger/index.tsx index 4b72e2ad3..987f8a686 100644 --- a/src/equicordplugins/soundBoardLogger/index.tsx +++ b/src/equicordplugins/soundBoardLogger/index.tsx @@ -4,28 +4,19 @@ * SPDX-License-Identifier: GPL-3.0-or-later */ -import { addChatBarButton, ChatBarButton, removeChatBarButton } from "@api/ChatButtons"; +import { addChatBarButton, removeChatBarButton } from "@api/ChatButtons"; import { disableStyle, enableStyle } from "@api/Styles"; import { Devs, EquicordDevs } from "@utils/constants"; import definePlugin from "@utils/types"; import { FluxDispatcher } from "@webpack/common"; -import { IconWithTooltip, LogIcon } from "./components/Icons"; +import { ChatBarIcon, IconWithTooltip, LogIcon } from "./components/Icons"; import { openSoundBoardLog } from "./components/SoundBoardLog"; import settings from "./settings"; import { updateLoggedSounds } from "./store"; import styles from "./styles.css?managed"; import { getListeners } from "./utils"; -const chatBarIcon: ChatBarButton = () => { - return ( - - - - ); -}; - export default definePlugin({ name: "SoundBoardLogger", authors: [ @@ -53,11 +44,11 @@ export default definePlugin({ await updateLoggedSounds(sound); getListeners().forEach(cb => cb()); }); - if (settings.store.IconLocation === "chat") addChatBarButton("soundboardlogger-button", chatBarIcon); + if (settings.store.IconLocation === "chat") addChatBarButton("vc-soundlog-button", ChatBarIcon); }, stop() { disableStyle(styles); - if (settings.store.IconLocation === "chat") removeChatBarButton("soundboardlogger-button"); + if (settings.store.IconLocation === "chat") removeChatBarButton("vc-soundlog-button"); }, toolbarPatch: obj => { if (!obj?.props?.children) return obj;