diff --git a/src/plugins/CopyFileContents/index.tsx b/src/plugins/CopyFileContents/index.tsx deleted file mode 100644 index 13b649174..000000000 --- a/src/plugins/CopyFileContents/index.tsx +++ /dev/null @@ -1,60 +0,0 @@ -/* - * Vencord, a Discord client mod - * Copyright (c) 2024 Vendicated and contributors - * SPDX-License-Identifier: GPL-3.0-or-later - */ - -import "./style.css"; - -import ErrorBoundary from "@components/ErrorBoundary"; -import { CopyIcon, NoEntrySignIcon } from "@components/Icons"; -import { Devs } from "@utils/constants"; -import { copyWithToast } from "@utils/misc"; -import definePlugin from "@utils/types"; -import { Tooltip, useState } from "@webpack/common"; - -const CheckMarkIcon = () => { - return - - ; -}; - -export default definePlugin({ - name: "CopyFileContents", - description: "Adds a button to text file attachments to copy their contents", - authors: [Devs.Obsidian, Devs.Nuckyz], - patches: [ - { - find: ".Messages.PREVIEW_BYTES_LEFT.format(", - replacement: { - match: /\.footerGap.+?url:\i,fileName:\i,fileSize:\i}\),(?<=fileContents:(\i),bytesLeft:(\i).+?)/g, - replace: "$&$self.addCopyButton({fileContents:$1,bytesLeft:$2})," - } - } - ], - - addCopyButton: ErrorBoundary.wrap(({ fileContents, bytesLeft }: { fileContents: string, bytesLeft: number; }) => { - const [recentlyCopied, setRecentlyCopied] = useState(false); - - return ( - 0 ? "File too large to copy" : "Copy File Contents"}> - {tooltipProps => ( -
{ - if (!recentlyCopied && bytesLeft <= 0) { - copyWithToast(fileContents); - setRecentlyCopied(true); - setTimeout(() => setRecentlyCopied(false), 2000); - } - }} - > - {recentlyCopied ? : bytesLeft > 0 ? : } -
- )} -
- ); - }, { noop: true }), -}); diff --git a/src/plugins/CopyFileContents/style.css b/src/plugins/CopyFileContents/style.css deleted file mode 100644 index c643cf0f0..000000000 --- a/src/plugins/CopyFileContents/style.css +++ /dev/null @@ -1,8 +0,0 @@ -.vc-cfc-button { - color: var(--interactive-normal); - cursor: pointer; -} - -.vc-cfc-button:hover { - color: var(--interactive-hover); -} diff --git a/src/plugins/copyFileContents/index.tsx b/src/plugins/copyFileContents/index.tsx deleted file mode 100644 index 13b649174..000000000 --- a/src/plugins/copyFileContents/index.tsx +++ /dev/null @@ -1,60 +0,0 @@ -/* - * Vencord, a Discord client mod - * Copyright (c) 2024 Vendicated and contributors - * SPDX-License-Identifier: GPL-3.0-or-later - */ - -import "./style.css"; - -import ErrorBoundary from "@components/ErrorBoundary"; -import { CopyIcon, NoEntrySignIcon } from "@components/Icons"; -import { Devs } from "@utils/constants"; -import { copyWithToast } from "@utils/misc"; -import definePlugin from "@utils/types"; -import { Tooltip, useState } from "@webpack/common"; - -const CheckMarkIcon = () => { - return - - ; -}; - -export default definePlugin({ - name: "CopyFileContents", - description: "Adds a button to text file attachments to copy their contents", - authors: [Devs.Obsidian, Devs.Nuckyz], - patches: [ - { - find: ".Messages.PREVIEW_BYTES_LEFT.format(", - replacement: { - match: /\.footerGap.+?url:\i,fileName:\i,fileSize:\i}\),(?<=fileContents:(\i),bytesLeft:(\i).+?)/g, - replace: "$&$self.addCopyButton({fileContents:$1,bytesLeft:$2})," - } - } - ], - - addCopyButton: ErrorBoundary.wrap(({ fileContents, bytesLeft }: { fileContents: string, bytesLeft: number; }) => { - const [recentlyCopied, setRecentlyCopied] = useState(false); - - return ( - 0 ? "File too large to copy" : "Copy File Contents"}> - {tooltipProps => ( -
{ - if (!recentlyCopied && bytesLeft <= 0) { - copyWithToast(fileContents); - setRecentlyCopied(true); - setTimeout(() => setRecentlyCopied(false), 2000); - } - }} - > - {recentlyCopied ? : bytesLeft > 0 ? : } -
- )} -
- ); - }, { noop: true }), -}); diff --git a/src/plugins/copyFileContents/style.css b/src/plugins/copyFileContents/style.css deleted file mode 100644 index c643cf0f0..000000000 --- a/src/plugins/copyFileContents/style.css +++ /dev/null @@ -1,8 +0,0 @@ -.vc-cfc-button { - color: var(--interactive-normal); - cursor: pointer; -} - -.vc-cfc-button:hover { - color: var(--interactive-hover); -}