From 1efe62d13bdd8c3e7a6d8d33fb8b040e12fb3fac Mon Sep 17 00:00:00 2001 From: Badi Ifaoui Date: Wed, 29 Nov 2023 16:31:22 +0100 Subject: [PATCH] fix: missing package & ts issues --- package.json | 2 ++ res/themes/superhero/img/icons/diamond.svg | 4 +++- res/themes/superhero/img/icons/tokens.svg | 2 +- .../views/spaces/MintTokenButton.tsx | 7 +++--- src/components/views/spaces/SpacePanel.tsx | 22 ++++++++++--------- .../views/spaces/SuperheroDexButton.tsx | 3 ++- yarn.lock | 7 ++++++ 7 files changed, 31 insertions(+), 16 deletions(-) diff --git a/package.json b/package.json index 9dd76e7dd0..069e21bdeb 100644 --- a/package.json +++ b/package.json @@ -116,6 +116,7 @@ "@types/node": "^16", "@types/node-fetch": "^2.6.4", "@types/react": "17.0.68", + "@types/react-beautiful-dnd": "^13.1.7", "@types/react-dom": "17.0.21", "@types/ua-parser-js": "^0.7.36", "@typescript-eslint/eslint-plugin": "^5.45.0", @@ -171,6 +172,7 @@ "process": "^0.11.10", "proxy-agent": "^6.3.0", "raw-loader": "^4.0.2", + "react-beautiful-dnd": "^13.1.0", "rimraf": "^5.0.0", "semver": "^7.5.2", "setimmediate": "^1.0.5", diff --git a/res/themes/superhero/img/icons/diamond.svg b/res/themes/superhero/img/icons/diamond.svg index 3dde2a30d9..605a7794cf 100644 --- a/res/themes/superhero/img/icons/diamond.svg +++ b/res/themes/superhero/img/icons/diamond.svg @@ -1,3 +1,5 @@ - + diff --git a/res/themes/superhero/img/icons/tokens.svg b/res/themes/superhero/img/icons/tokens.svg index 3a9dbdadca..c4b45c7c24 100644 --- a/res/themes/superhero/img/icons/tokens.svg +++ b/res/themes/superhero/img/icons/tokens.svg @@ -1,5 +1,5 @@ + fill="currentColor" /> diff --git a/src/components/views/spaces/MintTokenButton.tsx b/src/components/views/spaces/MintTokenButton.tsx index 8d2feae0cb..ce4cd51bb5 100644 --- a/src/components/views/spaces/MintTokenButton.tsx +++ b/src/components/views/spaces/MintTokenButton.tsx @@ -1,8 +1,9 @@ import classNames from "classnames"; import AccessibleTooltipButton from "matrix-react-sdk/src/components/views/elements/AccessibleTooltipButton"; -import { _t } from "matrix-react-sdk/src/languageHandler"; import React, { useCallback } from "react"; +import { _t } from "../../../languageHandler"; + const MintTokenButton: React.FC<{ isPanelCollapsed: boolean; }> = ({ isPanelCollapsed = false }) => { @@ -19,11 +20,11 @@ const MintTokenButton: React.FC<{ expanded: !isPanelCollapsed, })} onClick={onOpenDex} - title={_t('mint_a_token')} + title={_t("mint_a_token")} forceHide={!isPanelCollapsed} aria-expanded={!isPanelCollapsed} > - {!isPanelCollapsed ? _t('mint_a_token') : null} + {!isPanelCollapsed ? _t("mint_a_token") : null} ); diff --git a/src/components/views/spaces/SpacePanel.tsx b/src/components/views/spaces/SpacePanel.tsx index b8395d6459..8d0566a86d 100644 --- a/src/components/views/spaces/SpacePanel.tsx +++ b/src/components/views/spaces/SpacePanel.tsx @@ -61,6 +61,7 @@ import SpaceStore from "matrix-react-sdk/src/stores/spaces/SpaceStore"; import React, { ComponentProps, Dispatch, + ReactElement, ReactNode, RefCallback, SetStateAction, @@ -71,6 +72,7 @@ import React, { useState, } from "react"; import { DragDropContext, Draggable, Droppable, DroppableProvidedProps } from "react-beautiful-dnd"; + import SuperheroDexButton from "./SuperheroDexButton"; import MintTokenButton from "./MintTokenButton"; @@ -104,7 +106,7 @@ export const HomeButtonContextMenu: React.FC { + onClick={(): void => { onFinished(); SettingsStore.setValue("Spaces.allRoomsInHome", null, SettingLevel.ACCOUNT, !allRoomsInHome); }} @@ -228,7 +230,7 @@ const CreateSpaceButton: React.FC { + : (): void => { if (!isPanelCollapsed) setPanelCollapsed(true); openMenu(); }; @@ -307,12 +309,12 @@ const InnerSpacePanel = React.memo( space={s} activeSpaces={activeSpaces} isPanelCollapsed={isPanelCollapsed} - onExpand={() => setPanelCollapsed(false)} + onExpand={(): void => setPanelCollapsed(false)} /> ))} {actualSpaces.map((s, i) => ( - {(provided, snapshot) => ( + {(provided, snapshot): ReactElement => ( ( space={s} activeSpaces={activeSpaces} isPanelCollapsed={isPanelCollapsed} - onExpand={() => setPanelCollapsed(false)} + onExpand={(): void => setPanelCollapsed(false)} /> )} @@ -353,12 +355,12 @@ const SpacePanel: React.FC = () => { return ( - {({ onKeyDownHandler, onDragEndHandler }) => ( + {({ onKeyDownHandler, onDragEndHandler }): ReactElement => ( { + onDragStart={(): void => { setDragging(true); }} - onDragEnd={(result) => { + onDragEnd={(result): void => { setDragging(false); if (!result.destination) return; // dropped outside the list SpaceStore.instance.moveRootSpace(result.source.index, result.destination.index); @@ -373,7 +375,7 @@ const SpacePanel: React.FC = () => { setPanelCollapsed(!isPanelCollapsed)} + onClick={(): void => setPanelCollapsed(!isPanelCollapsed)} title={isPanelCollapsed ? _t("action|expand") : _t("action|collapse")} tooltip={
@@ -393,7 +395,7 @@ const SpacePanel: React.FC = () => { /> - {(provided, snapshot) => ( + {(provided, snapshot): ReactElement => ( = ({ isPanelCollapsed = false }) => { diff --git a/yarn.lock b/yarn.lock index 585819d42d..c91654e9d3 100644 --- a/yarn.lock +++ b/yarn.lock @@ -2782,6 +2782,13 @@ resolved "https://registry.yarnpkg.com/@types/range-parser/-/range-parser-1.2.7.tgz#50ae4353eaaddc04044279812f52c8c65857dbcb" integrity sha512-hKormJbkJqzQGhziax5PItDUTMAM9uE2XXQmM37dyd4hVM+5aVl7oVxMVUiVQn2oCQFN/LKCZdvSM0pFRqbSmQ== +"@types/react-beautiful-dnd@^13.1.7": + version "13.1.7" + resolved "https://registry.yarnpkg.com/@types/react-beautiful-dnd/-/react-beautiful-dnd-13.1.7.tgz#cc8038896ee7dee99b8bfd0eaed0a02a8617bedc" + integrity sha512-jQZLov9OkD0xRQkqz8/lx66bHYAYv+g4+POBqnH5Jtt/xo4MygzM879Q9sxAiosPBdNj1JYTdbPxDn3dNRYgow== + dependencies: + "@types/react" "*" + "@types/react-dom@17.0.21", "@types/react-dom@<18.0.0": version "17.0.21" resolved "https://registry.yarnpkg.com/@types/react-dom/-/react-dom-17.0.21.tgz#85d56965483ce4850f5f03f9234e54a1f47786e5"