From be033843dc13cf9e51382f50d60d2c26b359b2b1 Mon Sep 17 00:00:00 2001 From: Sara Subijana Gracia Date: Tue, 10 Oct 2023 13:21:10 +0200 Subject: [PATCH] feat: change text button when activity cannot be updated, only show details --- .../components/activities-list/activities-list-table.tsx | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/features/binnacle/features/activity/ui/components/activities-list/activities-list-table.tsx b/src/features/binnacle/features/activity/ui/components/activities-list/activities-list-table.tsx index 1b9c6291..72e3182c 100644 --- a/src/features/binnacle/features/activity/ui/components/activities-list/activities-list-table.tsx +++ b/src/features/binnacle/features/activity/ui/components/activities-list/activities-list-table.tsx @@ -21,6 +21,9 @@ export const ActivitiesListTable = ({ }: Props) => { const isMobile = useIsMobile() const { t } = useTranslation() + const isActivityApproved = (activity: Activity) => { + return activity.approval.state == 'ACCEPTED' + } const tableActivities = useMemo(() => { if (!activities) return [] @@ -83,9 +86,9 @@ export const ActivitiesListTable = ({ onOpenActivity(activity) }} > - {t('actions.edit')} + {!isActivityApproved(activity) ? t('actions.edit') : t('actions.show')} - {activity.approval.state !== 'ACCEPTED' && ( + {!isActivityApproved(activity) && (