From c65d8be7d80b1943fd70aa5f0b3f4cfa472f7db0 Mon Sep 17 00:00:00 2001 From: Michael Telatynski <7t3chguy@gmail.com> Date: Thu, 24 Sep 2020 09:49:30 +0100 Subject: [PATCH] delint Signed-off-by: Michael Telatynski <7t3chguy@gmail.com> --- src/components/structures/LeftPanelWidget.tsx | 33 +++++++------------ src/utils/WidgetUtils.ts | 26 +++++++++++++-- 2 files changed, 35 insertions(+), 24 deletions(-) diff --git a/src/components/structures/LeftPanelWidget.tsx b/src/components/structures/LeftPanelWidget.tsx index 1f1a963f8f..f12c5ca2f9 100644 --- a/src/components/structures/LeftPanelWidget.tsx +++ b/src/components/structures/LeftPanelWidget.tsx @@ -54,7 +54,7 @@ const LeftPanelWidget: React.FC = ({ onResize }) => { widgetConfig.sender, null, widgetConfig.id); - }, [cli, mWidgetsEvent, leftPanelWidgetId]); + }, [mWidgetsEvent, leftPanelWidgetId]); const [height, setHeight] = useLocalStorageState("left-panel-widget-height", INITIAL_HEIGHT); const [expanded, setExpanded] = useLocalStorageState("left-panel-widget-expanded", true); @@ -65,21 +65,6 @@ const LeftPanelWidget: React.FC = ({ onResize }) => { if (!app) return null; - let auxButton = null; - if (1) { - auxButton = ( - { - console.log("@@ Maximise Left Panel Widget") - }} - className="mx_LeftPanelWidget_maximizeButton" - tooltipClassName="mx_LeftPanelWidget_maximizeButtonTooltip" - title={_t("Maximize")} - /> - ); - } - let content; if (expanded) { content = = ({ onResize }) => { return
{ switch (ev.key) { case Key.ARROW_LEFT: @@ -149,7 +131,16 @@ const LeftPanelWidget: React.FC = ({ onResize }) => { })} /> { WidgetUtils.getWidgetName(app) } - { auxButton } + + {/* Code for the maximise button for once we have full screen widgets */} + {/* { + }} + className="mx_LeftPanelWidget_maximizeButton" + tooltipClassName="mx_LeftPanelWidget_maximizeButtonTooltip" + title={_t("Maximize")} + />*/}
diff --git a/src/utils/WidgetUtils.ts b/src/utils/WidgetUtils.ts index 338b856edf..bcf4324d6f 100644 --- a/src/utils/WidgetUtils.ts +++ b/src/utils/WidgetUtils.ts @@ -41,6 +41,7 @@ export interface IWidget { id: string; type: string; sender: string; + // eslint-disable-next-line camelcase state_key: string; content: Partial; } @@ -224,7 +225,13 @@ export default class WidgetUtils { }); } - static setUserWidget(widgetId: string, widgetType: WidgetType, widgetUrl: string, widgetName: string, widgetData: object) { + static setUserWidget( + widgetId: string, + widgetType: WidgetType, + widgetUrl: string, + widgetName: string, + widgetData: object, + ) { const content = { type: widgetType.preferred, url: widgetUrl, @@ -268,7 +275,14 @@ export default class WidgetUtils { }); } - static setRoomWidget(roomId: string, widgetId: string, widgetType: WidgetType, widgetUrl: string, widgetName: string, widgetData: object) { + static setRoomWidget( + roomId: string, + widgetId: string, + widgetType: WidgetType, + widgetUrl: string, + widgetName: string, + widgetData: object, + ) { let content; const addingWidget = Boolean(widgetUrl); @@ -410,7 +424,13 @@ export default class WidgetUtils { return client.setAccountData('m.widgets', userWidgets); } - static makeAppConfig(appId: string, app: Partial, senderUserId: string, roomId: string | null, eventId: string): IApp { + static makeAppConfig( + appId: string, + app: Partial, + senderUserId: string, + roomId: string | null, + eventId: string, + ): IApp { if (!senderUserId) { throw new Error("Widgets must be created by someone - provide a senderUserId"); }