Skip to content

Commit

Permalink
Merge pull request #185 from autentia/feat/activity-option-disabled-f…
Browse files Browse the repository at this point in the history
…or-accepted-activities

feat: disable remove option for accepted activities in activities list view
  • Loading branch information
Manumartin95 authored Oct 10, 2023
2 parents 7ebe428 + be03384 commit d6ca4d5
Showing 1 changed file with 11 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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 []
Expand Down Expand Up @@ -83,9 +86,15 @@ export const ActivitiesListTable = ({
onOpenActivity(activity)
}}
>
{t('actions.edit')}
{!isActivityApproved(activity) ? t('actions.edit') : t('actions.show')}
</Button>
<RemoveActivityButton activity={activity} onDeleted={onDeleteActivity} redNoIcon={true} />
{!isActivityApproved(activity) && (
<RemoveActivityButton
activity={activity}
onDeleted={onDeleteActivity}
redNoIcon={true}
/>
)}
</Fragment>
)
}
Expand Down

0 comments on commit d6ca4d5

Please sign in to comment.