diff --git a/src/api/Tablist.tsx b/src/api/Tablist.tsx
index db21cb9b0..a9271b627 100644
--- a/src/api/Tablist.tsx
+++ b/src/api/Tablist.tsx
@@ -1,4 +1,5 @@
import { Channel } from "discord-types/general";
+import ErrorBoundary from "@components/ErrorBoundary";
//import { Logger } from "@utils/Logger";
//const logger = new Logger("Tablist"); useless
@@ -44,24 +45,22 @@ export const addTablistButton = (id: string, tab: string, PanelComponent: Tablis
export const removeTablistButton = (id: string) => TablistComponents.delete(id);
-export function* RenderButtons(TablistButtonComponent: TablistButtonComponent, selectedTab: string, expressionMate: ExpressionMate) {
- for (const tab in TablistComponents) {
+export function* RenderButtons(TablistButtonComponent: TablistButtonComponent, selectedTab: string) {
+ for (const [id, { tab }] of TablistComponents) {
yield ({TablistComponents[tab].tab}
- );
+ id={id + "-picker-tab"}
+ aria-controls={id + "-picker-tab-panel"}
+ aria-selected={id === selectedTab}
+ viewType={id}
+ isActive={id === selectedTab}
+ >{tab});
}
}
export function* TabPanels(selectedTab: string, expressionMate: ExpressionMate, channel: Channel) {
- for (const tab in TablistComponents) {
- if (tab !== selectedTab) { continue; }
- let PanelComponent: TablistPanelComponent = TablistComponents[tab].Component;
- yield ();
+ for (const [id, { Component }] of TablistComponents) {
+ if (id !== selectedTab) { continue; }
+ let PanelComponent: TablistPanelComponent = Component;
+ yield ();
}
}
diff --git a/src/plugins/_api/tablist.ts b/src/plugins/_api/tablist.ts
index 2a1181e9a..02b2f9cef 100644
--- a/src/plugins/_api/tablist.ts
+++ b/src/plugins/_api/tablist.ts
@@ -11,8 +11,8 @@ export default definePlugin({
find: ".EXPRESSION_PICKER_CATEGORIES_A11Y_LABEL",
replacement: [
{
- match: /\.jsx)\((\i),\{id:\i\.\i,.+?,"aria-selected":(\i)===.+?,viewType:(\i).+?\}\)/,//\]
- replace: "$&,...Vencord.Api.Tablist.RenderButtons($1, $2, $3)"
+ match: /\.jsx\)\((\i),\{id:\i\.E\i,.+?,"aria-selected":(\i)===\i\.\i\.EMOJI.+?,viewType:(\i).+?\}\)/,
+ replace: "$&,...Vencord.Api.Tablist.RenderButtons($1, $2)"
},
{
match: /null,(\i)===(\i)\.ExpressionPickerViewType\.EMOJI\?.{0,55}channel:(\i),.+?\):null/,