From 2b252c4011a6ea82c5a8654331bdf7cf3323de73 Mon Sep 17 00:00:00 2001 From: programminglaboratorys <107296738+programminglaboratorys@users.noreply.github.com> Date: Mon, 20 May 2024 20:15:39 +0300 Subject: [PATCH] name update, and added ErrorBoundary to RenderTabButtons --- src/api/{Tablist.tsx => ExpressionPickerTabs.tsx} | 6 +++--- src/api/index.ts | 4 ++-- src/plugins/_api/{tablist.ts => expressionPickerTabs.ts} | 8 ++++---- 3 files changed, 9 insertions(+), 9 deletions(-) rename src/api/{Tablist.tsx => ExpressionPickerTabs.tsx} (90%) rename src/plugins/_api/{tablist.ts => expressionPickerTabs.ts} (67%) diff --git a/src/api/Tablist.tsx b/src/api/ExpressionPickerTabs.tsx similarity index 90% rename from src/api/Tablist.tsx rename to src/api/ExpressionPickerTabs.tsx index a9271b627..e7ba82533 100644 --- a/src/api/Tablist.tsx +++ b/src/api/ExpressionPickerTabs.tsx @@ -45,15 +45,15 @@ export const addTablistButton = (id: string, tab: string, PanelComponent: Tablis export const removeTablistButton = (id: string) => TablistComponents.delete(id); -export function* RenderButtons(TablistButtonComponent: TablistButtonComponent, selectedTab: string) { +export function* RenderTabButtons(TablistButtonComponent: TablistButtonComponent, selectedTab: string) { for (const [id, { tab }] of TablistComponents) { - yield ({tab}); + >{tab}); } } diff --git a/src/api/index.ts b/src/api/index.ts index b9e022fcc..fa081819f 100644 --- a/src/api/index.ts +++ b/src/api/index.ts @@ -31,7 +31,7 @@ import * as $Notifications from "./Notifications"; import * as $ServerList from "./ServerList"; import * as $Settings from "./Settings"; import * as $Styles from "./Styles"; -import * as $Tablist from "./Tablist"; +import * as $ExpressionPickerTabs from "./ExpressionPickerTabs"; /** * An API allowing you to listen to Message Clicks or run your own logic @@ -115,4 +115,4 @@ export const ChatButtons = $ChatButtons; /** * An API allowing you to add panels to the expression picker */ -export const Tablist = $Tablist; +export const ExpressionPickerTabs = $ExpressionPickerTabs; diff --git a/src/plugins/_api/tablist.ts b/src/plugins/_api/expressionPickerTabs.ts similarity index 67% rename from src/plugins/_api/tablist.ts rename to src/plugins/_api/expressionPickerTabs.ts index 02b2f9cef..3af0e4304 100644 --- a/src/plugins/_api/tablist.ts +++ b/src/plugins/_api/expressionPickerTabs.ts @@ -3,8 +3,8 @@ import { Devs } from "@utils/constants"; export default definePlugin({ - name: "TablistApi", - description: "API to add panels to the expression picker", + name: "ExpressionPickerTabsAPI", + description: "an API to add panels to the expression picker", authors: [Devs.iamme], patches: [ { @@ -12,11 +12,11 @@ export default definePlugin({ replacement: [ { match: /\.jsx\)\((\i),\{id:\i\.E\i,.+?,"aria-selected":(\i)===\i\.\i\.EMOJI.+?,viewType:(\i).+?\}\)/, - replace: "$&,...Vencord.Api.Tablist.RenderButtons($1, $2)" + replace: "$&,...Vencord.Api.ExpressionPickerTabs.RenderTabButtons($1, $2)" }, { match: /null,(\i)===(\i)\.ExpressionPickerViewType\.EMOJI\?.{0,55}channel:(\i),.+?\):null/, - replace: "$&,...Vencord.Api.Tablist.TabPanels($1, $2, $3)" + replace: "$&,...Vencord.Api.ExpressionPickerTabs.TabPanels($1, $2, $3)" } ] }