diff --git a/rsconcept/frontend/src/pages/RSFormPage/EditorConstituenta/EditorConstituenta.tsx b/rsconcept/frontend/src/pages/RSFormPage/EditorConstituenta/EditorConstituenta.tsx index cfb6bc96..8c4e5a21 100644 --- a/rsconcept/frontend/src/pages/RSFormPage/EditorConstituenta/EditorConstituenta.tsx +++ b/rsconcept/frontend/src/pages/RSFormPage/EditorConstituenta/EditorConstituenta.tsx @@ -3,6 +3,7 @@ import { Dispatch, SetStateAction, useMemo, useState } from 'react'; import { useRSForm } from '@/context/RSFormContext'; +import useLocalStorage from '@/hooks/useLocalStorage'; import useWindowSize from '@/hooks/useWindowSize'; import { CstType, IConstituenta, ICstCreateData, ICstRenameData } from '@/models/rsform'; import { globalIDs } from '@/utils/constants'; @@ -39,6 +40,7 @@ function EditorConstituenta({ const windowSize = useWindowSize(); const { schema } = useRSForm(); + const [showList, setShowList] = useLocalStorage('rseditor-show-list', true); const [toggleReset, setToggleReset] = useState(false); const disabled = useMemo(() => (!activeCst || !isMutable), [activeCst, isMutable]); @@ -136,16 +138,18 @@ function EditorConstituenta({ onKeyDown={handleInput} > setShowList(prev => !prev)} setIsModified={setIsModified} onEditTerm={onEditTerm} onRenameCst={onRenameCst} /> - {(windowSize.width && windowSize.width >= SIDELIST_HIDE_THRESHOLD) ? + {(showList && windowSize.width && windowSize.width >= SIDELIST_HIDE_THRESHOLD) ? > + onToggleList: () => void onRenameCst: (initial: ICstRenameData) => void onEditTerm: () => void } function FormConstituenta({ - disabled, + disabled, showList, id, isModified, setIsModified, constituenta, toggleReset, - onRenameCst, onEditTerm + onRenameCst, onEditTerm, onToggleList }: FormConstituentaProps) { const { schema, cstUpdate, processing } = useRSForm(); @@ -158,11 +160,13 @@ function FormConstituenta({ /> setExpression(newValue)} setTypification={setTypification} /> diff --git a/rsconcept/frontend/src/pages/RSFormPage/EditorRSExpression/EditorRSExpression.tsx b/rsconcept/frontend/src/pages/RSFormPage/EditorRSExpression/EditorRSExpression.tsx index 828040b0..1a8a9acc 100644 --- a/rsconcept/frontend/src/pages/RSFormPage/EditorRSExpression/EditorRSExpression.tsx +++ b/rsconcept/frontend/src/pages/RSFormPage/EditorRSExpression/EditorRSExpression.tsx @@ -2,6 +2,7 @@ import { ReactCodeMirrorRef } from '@uiw/react-codemirror'; import { useCallback, useLayoutEffect, useRef, useState } from 'react'; +import { BiListUl } from 'react-icons/bi'; import { FaRegKeyboard } from 'react-icons/fa6'; import { RiNodeTree } from 'react-icons/ri' import { toast } from 'react-toastify'; @@ -27,18 +28,23 @@ import StatusBar from './StatusBar'; interface EditorRSExpressionProps { id?: string activeCst?: IConstituenta + value: string label: string + placeholder?: string + disabled?: boolean toggleReset?: boolean - placeholder?: string + showList: boolean + setTypification: (typificaiton: string) => void - value: string onChange: (newValue: string) => void + onToggleList: () => void } function EditorRSExpression({ - activeCst, disabled, value, toggleReset, - setTypification, onChange, ...restProps + activeCst, disabled, value, toggleReset, showList, + setTypification, onChange, onToggleList, + ...restProps }: EditorRSExpressionProps) { const { schema } = useRSForm(); @@ -138,10 +144,15 @@ function EditorRSExpression({
setShowControls(prev => !prev)} icon={} /> + } + />