From 5fdd8e079342876af0dad28c65288480779ee4cb Mon Sep 17 00:00:00 2001 From: Charles Bochet Date: Sun, 13 Aug 2023 10:49:28 -0700 Subject: [PATCH] Fix boardcard selected state and fix table new row being added on top --- front/src/modules/companies/components/CompanyBoardCard.tsx | 2 +- front/src/modules/ui/table/hooks/useUpsertTableRowId.ts | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/front/src/modules/companies/components/CompanyBoardCard.tsx b/front/src/modules/companies/components/CompanyBoardCard.tsx index 9af126435..08bd59aed 100644 --- a/front/src/modules/companies/components/CompanyBoardCard.tsx +++ b/front/src/modules/companies/components/CompanyBoardCard.tsx @@ -40,7 +40,7 @@ const StyledBoardCard = styled.div<{ selected: boolean }>` cursor: pointer; .checkbox-container { - opacity: 0; + opacity: ${({ selected }) => (selected ? 1 : 0)}; } &:hover .checkbox-container { diff --git a/front/src/modules/ui/table/hooks/useUpsertTableRowId.ts b/front/src/modules/ui/table/hooks/useUpsertTableRowId.ts index a812f811d..0a8d519af 100644 --- a/front/src/modules/ui/table/hooks/useUpsertTableRowId.ts +++ b/front/src/modules/ui/table/hooks/useUpsertTableRowId.ts @@ -10,7 +10,7 @@ export function useUpsertTableRowId() { .getLoadable(tableRowIdsState) .valueOrThrow(); - set(tableRowIdsState, Array.from(new Set([...currentRowIds, rowId]))); + set(tableRowIdsState, Array.from(new Set([rowId, ...currentRowIds]))); }, [], );