diff --git a/app/scenes/CollectionPermissions/AddPeopleToCollection.tsx b/app/scenes/CollectionPermissions/AddPeopleToCollection.tsx index 0fc48f8cf..a933b9713 100644 --- a/app/scenes/CollectionPermissions/AddPeopleToCollection.tsx +++ b/app/scenes/CollectionPermissions/AddPeopleToCollection.tsx @@ -16,6 +16,7 @@ import PaginatedList from "~/components/PaginatedList"; import Text from "~/components/Text"; import useBoolean from "~/hooks/useBoolean"; import useCurrentTeam from "~/hooks/useCurrentTeam"; +import usePolicy from "~/hooks/usePolicy"; import useStores from "~/hooks/useStores"; import useThrottledCallback from "~/hooks/useThrottledCallback"; import MemberListItem from "./components/MemberListItem"; @@ -28,6 +29,8 @@ function AddPeopleToCollection({ collection }: Props) { const { memberships, users } = useStores(); const team = useCurrentTeam(); const { t } = useTranslation(); + const can = usePolicy(team); + const [inviteModalOpen, setInviteModalOpen, setInviteModalClosed] = useBoolean(); const [query, setQuery] = React.useState(""); @@ -68,11 +71,15 @@ function AddPeopleToCollection({ collection }: Props) { {t("Need to add someone who’s not on the team yet?")}{" "} - - {t("Invite people to {{ teamName }}", { - teamName: team.name, - })} - + {can.inviteUser ? ( + + {t("Invite people to {{ teamName }}", { + teamName: team.name, + })} + + ) : ( + t("Ask an admin to invite them first") + )} . - {t("Invite them to {{teamName}}", { - teamName: team.name, - })} - + {can.inviteUser ? ( + + {t("Invite them to {{teamName}}", { + teamName: team.name, + })} + + ) : ( + t("Ask an admin to invite them first") + )} .