diff --git a/app/scenes/Invite.tsx b/app/scenes/Invite.tsx index 7ed40dc08..0ee12f219 100644 --- a/app/scenes/Invite.tsx +++ b/app/scenes/Invite.tsx @@ -41,7 +41,7 @@ function Invite({ onSubmit }: Props) { role: UserRole.Member, }, ]); - const { users } = useStores(); + const { users, collections } = useStores(); const user = useCurrentUser(); const team = useCurrentTeam(); const { t } = useTranslation(); @@ -136,6 +136,27 @@ function Invite({ onSubmit }: Props) { [handleAdd] ); + const collectionCount = collections.nonPrivate.length; + const collectionAccessNote = ( + + Invited members will receive access to{" "} + + {collections.nonPrivate.map((collection) => ( +
  • {collection.name}
  • + ))} + + } + > + + {{ collectionCount }} collections + +
    + . +
    + ); + return (
    {team.guestSignin ? ( @@ -145,7 +166,8 @@ function Invite({ onSubmit }: Props) { values={{ signinMethods: team.signinMethods, }} - /> + />{" "} + {collectionAccessNote} ) : ( @@ -160,7 +182,8 @@ function Invite({ onSubmit }: Props) { As an admin you can also{" "} enable email sign-in. - )} + )}{" "} + {collectionAccessNote} )} {team.subdomain && ( @@ -270,4 +293,8 @@ const Remove = styled("div")` margin-right: -32px; `; +const Def = styled("span")` + text-decoration: underline dotted; +`; + export default observer(Invite); diff --git a/app/stores/CollectionsStore.ts b/app/stores/CollectionsStore.ts index 1585b4a33..c97929744 100644 --- a/app/stores/CollectionsStore.ts +++ b/app/stores/CollectionsStore.ts @@ -67,6 +67,11 @@ export default class CollectionsStore extends Store { }); } + @computed + get nonPrivate(): Collection[] { + return this.all.filter((collection) => collection.isPrivate); + } + @computed get all(): Collection[] { return sortBy( diff --git a/shared/i18n/locales/en_US/translation.json b/shared/i18n/locales/en_US/translation.json index fb77846cc..5b8aebb14 100644 --- a/shared/i18n/locales/en_US/translation.json +++ b/shared/i18n/locales/en_US/translation.json @@ -632,6 +632,8 @@ "We sent out your invites!": "We sent out your invites!", "Those email addresses are already invited": "Those email addresses are already invited", "Sorry, you can only send {{MAX_INVITES}} invites at a time": "Sorry, you can only send {{MAX_INVITES}} invites at a time", + "Invited members will receive access to": "Invited members will receive access to", + "{{collectionCount}} collections": "{{collectionCount}} collections", "Invite members or guests to join your workspace. They can sign in with {{signinMethods}} or use their email address.": "Invite members or guests to join your workspace. They can sign in with {{signinMethods}} or use their email address.", "Invite members to join your workspace. They will need to sign in with {{signinMethods}}.": "Invite members to join your workspace. They will need to sign in with {{signinMethods}}.", "As an admin you can also <2>enable email sign-in.": "As an admin you can also <2>enable email sign-in.",