From 1a5a9771ed9dbffaa3c9a3172c220ae81f14e754 Mon Sep 17 00:00:00 2001 From: Steinar Freyr Kristinsson Date: Tue, 3 Dec 2024 14:43:14 +0100 Subject: [PATCH 1/2] fix(consultation-portal): Enable user to deregister from "all" cases --- .../components/SubscriptionTable/SubscriptionTable.tsx | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/apps/consultation-portal/screens/Subscriptions/components/SubscriptionTable/SubscriptionTable.tsx b/apps/consultation-portal/screens/Subscriptions/components/SubscriptionTable/SubscriptionTable.tsx index 1fb8965152a2..0410239ed433 100644 --- a/apps/consultation-portal/screens/Subscriptions/components/SubscriptionTable/SubscriptionTable.tsx +++ b/apps/consultation-portal/screens/Subscriptions/components/SubscriptionTable/SubscriptionTable.tsx @@ -54,8 +54,13 @@ const SubscriptionTable = ({ data: thisData, }) - if ( + const hasNoItemsToShow = dataToRender.length === 0 && + dontShowNew !== false && + dontShowChanges !== false + + if ( + hasNoItemsToShow && !subscribedToAllNewObj.checked && !subscribedToAllChangesObj.checked ) { From 7ee3e9cce52c9c08af80d99ad9127a1e8f0eb05c Mon Sep 17 00:00:00 2001 From: Steinar Freyr Kristinsson Date: Tue, 3 Dec 2024 14:43:41 +0100 Subject: [PATCH 2/2] chore(consultation-portal): Remove unused hook --- .../components/SubscriptionTable/SubscriptionTable.tsx | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/apps/consultation-portal/screens/Subscriptions/components/SubscriptionTable/SubscriptionTable.tsx b/apps/consultation-portal/screens/Subscriptions/components/SubscriptionTable/SubscriptionTable.tsx index 0410239ed433..f1de635486df 100644 --- a/apps/consultation-portal/screens/Subscriptions/components/SubscriptionTable/SubscriptionTable.tsx +++ b/apps/consultation-portal/screens/Subscriptions/components/SubscriptionTable/SubscriptionTable.tsx @@ -1,10 +1,5 @@ import React from 'react' -import { - Stack, - Table as T, - Text, - useBreakpoint, -} from '@island.is/island-ui/core' +import { Stack, Table as T, Text } from '@island.is/island-ui/core' import { mapIsToEn, sortLocale } from '../../../../utils/helpers' import { SubscriptionArray } from '../../../../types/interfaces' import { Area } from '../../../../types/enums' @@ -37,7 +32,6 @@ const SubscriptionTable = ({ searchValue, isMySubscriptions, }: Props) => { - const { md: mdBreakpoint } = useBreakpoint() const { Table, Body } = T const loc = localization.subscriptionTable const mappedCurrentTab = mapIsToEn[currentTab]