From 4d04fe76bca48145c397c075d0b8d2a171ed5dc8 Mon Sep 17 00:00:00 2001 From: IRBorisov <8611739+IRBorisov@users.noreply.github.com> Date: Sun, 9 Jun 2024 15:19:39 +0300 Subject: [PATCH] UI: Improve readonly mode --- .../RSFormPage/ViewConstituents/ViewConstituents.tsx | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/rsconcept/frontend/src/pages/RSFormPage/ViewConstituents/ViewConstituents.tsx b/rsconcept/frontend/src/pages/RSFormPage/ViewConstituents/ViewConstituents.tsx index f002448f..d844dd10 100644 --- a/rsconcept/frontend/src/pages/RSFormPage/ViewConstituents/ViewConstituents.tsx +++ b/rsconcept/frontend/src/pages/RSFormPage/ViewConstituents/ViewConstituents.tsx @@ -4,9 +4,11 @@ import clsx from 'clsx'; import { motion } from 'framer-motion'; import { useMemo, useState } from 'react'; +import { useAccessMode } from '@/context/AccessModeContext'; import { useConceptOptions } from '@/context/OptionsContext'; import useWindowSize from '@/hooks/useWindowSize'; import { ConstituentaID, IConstituenta, IRSForm } from '@/models/rsform'; +import { UserLevel } from '@/models/user'; import { animateSideView } from '@/styling/animations'; import ConstituentsSearch from './ConstituentsSearch'; @@ -29,20 +31,25 @@ interface ViewConstituentsProps { function ViewConstituents({ expression, schema, activeCst, isBottom, onOpenEdit }: ViewConstituentsProps) { const { calculateHeight } = useConceptOptions(); const windowSize = useWindowSize(); + const { accessLevel } = useAccessMode(); const [filteredData, setFilteredData] = useState(schema?.items ?? []); const table = useMemo( () => ( ), - [isBottom, filteredData, activeCst, onOpenEdit, calculateHeight] + [isBottom, filteredData, activeCst, onOpenEdit, calculateHeight, accessLevel] ); return (