From cd948a3aee4cf2de535d952f058cb12978a096d5 Mon Sep 17 00:00:00 2001 From: vapersmile Date: Fri, 8 Sep 2023 17:47:58 +0200 Subject: [PATCH] feat(readmine 1244989): add style for alert bar and hidden useless buttons --- .../src/3-custom/Components/Table/Table.tsx | 115 ++++++++++++++---- 1 file changed, 93 insertions(+), 22 deletions(-) diff --git a/packages/react-front-kit/src/3-custom/Components/Table/Table.tsx b/packages/react-front-kit/src/3-custom/Components/Table/Table.tsx index df755a95..4d161175 100644 --- a/packages/react-front-kit/src/3-custom/Components/Table/Table.tsx +++ b/packages/react-front-kit/src/3-custom/Components/Table/Table.tsx @@ -11,7 +11,13 @@ import { Star, Trash, } from '@phosphor-icons/react'; -import { MantineReactTable, useMantineReactTable } from 'mantine-react-table'; +import { + MRT_ShowHideColumnsButton as MRTShowHideColumnsButton, + MRT_ToggleFiltersButton as MRTToggleFiltersButton, + MantineReactTable, + useMantineReactTable, +} from 'mantine-react-table'; +import { MRT_Localization_FR } from 'mantine-react-table/locales/fr'; import { useMemo, useState } from 'react'; interface IDocument { @@ -192,7 +198,12 @@ export function Table(): JSX.Element { columnPinning: { right: ['mrt-row-actions'], }, + columnVisibility: { + firstName: false, + id: false, + }, }, + localization: MRT_Localization_FR, mantinePaperProps: { sx: { border: 'hidden', @@ -211,6 +222,7 @@ export function Table(): JSX.Element { sx: { background: '#0B7285', border: 'none', + borderRadius: '4px', }, }), positionActionsColumn: 'last', @@ -254,25 +266,60 @@ export function Table(): JSX.Element { style={{ color: 'white', display: 'flex', - padding: '4px 8px', + justifyContent: 'space-between', + padding: '0px 8px', width: '100%', }} > -

{cell.selectedAlert}

- - + + + + + ), + renderToolbarInternalActions: (cell) => ( + + + ), }); @@ -296,12 +343,12 @@ export function Table(): JSX.Element { // Handle const addToFavHandle = (): void => { setModalTitle( - 'Êtes vous sure de vouloir ajouter aux favoris cette élément ?' + 'Êtes vous sure de vouloir ajouter aux favoris cette document ?' ); setModalContent( <> + + + ); + open(); + }; const actionButtonOnMouseHandler = ( rowIndex: number, enter: boolean @@ -349,11 +413,18 @@ export function Table(): JSX.Element { ); setDisplayActionsButtons(newDisplayActionsButtonArray); }; - const sendCurrentElementValue = (action: string): void => { - // eslint-disable-next-line no-console + const sendCurrentElementValueWithAction = (action: string): void => { console.log(currentElement, action); close(); }; + const sendSelectedElementsValueWithAction = ( + values: IDocument[], + action: string + ): void => { + // eslint-disable-next-line no-console + console.log(values, action); + close(); + }; const menuAction = (