diff --git a/app/src/App/Editor/components/EditorCommon/EditWidgetModal.tsx b/app/src/App/Editor/components/EditorCommon/EditWidgetModal.tsx index 8b551080..1205a3ae 100644 --- a/app/src/App/Editor/components/EditorCommon/EditWidgetModal.tsx +++ b/app/src/App/Editor/components/EditorCommon/EditWidgetModal.tsx @@ -27,16 +27,15 @@ const styles: EditWidgetModalStyles = { const EditWidgetModal: FC = ({ widget, iconWidth = 18 }) => { const [displayNameValue, setDisplayNameValue] = useState(""); - const { displayWidgetName, getWidgetDictionaryFromWidget, selectedWidgets, updateWidgetV2 } = - useWidgets(); + const { displayWidgetName, getWidgetDictionaryFromWidget, updateWidgetV2 } = useWidgets(); const onDisplayNameInputChange = ({ target }: ChangeEvent) => { setDisplayNameValue(target.value); }; const onSave = () => { - updateWidgetV2(selectedWidgets[0].id, { - ...getWidgetDictionaryFromWidget(selectedWidgets[0].id), + updateWidgetV2(widget.id, { + ...getWidgetDictionaryFromWidget(widget.id), displayName: displayNameValue, }); clearInput(); diff --git a/app/src/App/Editor/components/EditorRightPanel/EditorWidgetsUIList.tsx b/app/src/App/Editor/components/EditorRightPanel/EditorWidgetsUIList.tsx index 80ce5ca5..84a5a546 100644 --- a/app/src/App/Editor/components/EditorRightPanel/EditorWidgetsUIList.tsx +++ b/app/src/App/Editor/components/EditorRightPanel/EditorWidgetsUIList.tsx @@ -8,6 +8,7 @@ import { getColor, getTypography, pxToRem } from "@themes/utils"; import { FC } from "react"; import { css } from "styled-components"; +import EditWidgetModal from "../EditorCommon/EditWidgetModal"; import EditorItemsList from "./EditorItemsList"; type EditorWidgetsUIListStyles = { @@ -38,7 +39,7 @@ const styles: EditorWidgetsUIListStyles = { }; const EditorWidgetsUIList: FC = () => { - const { addWidget, widgetsUI, removeWidget } = useWidgets(); + const { addWidget, displayWidgetName, widgetsUI, removeWidget } = useWidgets(); const { widgetsUIModules } = useWidgetsModules(); const handleClickMenuItem = (widget: WidgetDictionaryItem): void => { @@ -55,6 +56,8 @@ const EditorWidgetsUIList: FC = () => { title="UI Widgets" noItemsText="No UI widget on the scene." triggerButtonText="Add UI Widget" + editModal={(row) => } + displayItemName={displayWidgetName} handleClickRemove={handleClickRemove} cancelButton={{ text: "Cancel and close", diff --git a/app/src/Features/Widgets/EndScreen/EndScreen.tsx b/app/src/Features/Widgets/EndScreen/EndScreen.tsx index bb27ba46..7da5d77f 100644 --- a/app/src/Features/Widgets/EndScreen/EndScreen.tsx +++ b/app/src/Features/Widgets/EndScreen/EndScreen.tsx @@ -2,7 +2,7 @@ import { StyledWrapper, Typography } from "@app/Common/components/Html"; import Button from "@app/Common/components/Html/Button/Button"; import useScenes from "@app/Scenes/_actions/hooks/useScenes"; import createWidget from "@app/Widgets/_actions/utilities/createWidget"; -import { FieldType, WidgetType } from "@app/Widgets/_actions/widgetsConstants"; +import { WidgetType } from "@app/Widgets/_actions/widgetsConstants"; import { FC } from "react"; import { css } from "styled-components"; @@ -52,12 +52,4 @@ export const widget = createWidget({ reducer: null, type: WidgetType.UI, name: "End Screen", - options: [ - { - name: "translateXOnPlay", - displayName: "Translate X on play", - fieldType: FieldType.Checkbox, - defaultValue: false, - }, - ], });