Skip to content

Commit

Permalink
feat: change text button when activity cannot be updated, only show d…
Browse files Browse the repository at this point in the history
…etails
  • Loading branch information
ssubijana committed Oct 10, 2023
1 parent b0203ad commit be03384
Showing 1 changed file with 5 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,9 @@ export const ActivitiesListTable = ({
onOpenActivity(activity)
}}
>
{t('actions.edit')}
{!isActivityApproved(activity) ? t('actions.edit') : t('actions.show')}
</Button>
{activity.approval.state !== 'ACCEPTED' && (
{!isActivityApproved(activity) && (
<RemoveActivityButton
activity={activity}
onDeleted={onDeleteActivity}
Expand Down

0 comments on commit be03384

Please sign in to comment.