diff --git a/app/components/Sharing/SharePopover.tsx b/app/components/Sharing/SharePopover.tsx index 158934d257..0ba13d1118 100644 --- a/app/components/Sharing/SharePopover.tsx +++ b/app/components/Sharing/SharePopover.tsx @@ -24,6 +24,7 @@ import useBoolean from "~/hooks/useBoolean"; import useCurrentTeam from "~/hooks/useCurrentTeam"; import useCurrentUser from "~/hooks/useCurrentUser"; import useKeyDown from "~/hooks/useKeyDown"; +import useMobile from "~/hooks/useMobile"; import usePolicy from "~/hooks/usePolicy"; import useRequest from "~/hooks/useRequest"; import useStores from "~/hooks/useStores"; @@ -34,7 +35,7 @@ import { AvatarSize } from "../Avatar/Avatar"; import ButtonSmall from "../ButtonSmall"; import Empty from "../Empty"; import CollectionIcon from "../Icons/CollectionIcon"; -import { NativeInput } from "../Input"; +import Input, { NativeInput } from "../Input"; import NudeButton from "../NudeButton"; import Squircle from "../Squircle"; import Tooltip from "../Tooltip"; @@ -108,6 +109,7 @@ function SharePopover({ const { t } = useTranslation(); const can = usePolicy(document); const { userMemberships } = useStores(); + const isMobile = useMobile(); const [query, setQuery] = React.useState(""); const [picker, showPicker, hidePicker] = useBoolean(); const timeout = React.useRef>(); @@ -190,48 +192,67 @@ function SharePopover({ [showPicker, setQuery] ); + const backButton = ( + <> + {picker && ( + + + + )} + + ); + + const doneButton = picker ? ( + invitedInSession.length ? ( + + {t("Done")} + + ) : null + ) : ( + + + + + + ); + return ( <> - {can.manageUsers && ( - - - {picker && ( - - - - )} - + {backButton} + - - {picker ? ( - invitedInSession.length ? ( - - {t("Done")} - - ) : null - ) : ( - - - - - - )} - - )} + {doneButton} + + + ) : ( + + + {backButton} + + {doneButton} + + + ))} {picker && (
@@ -446,7 +467,7 @@ const Separator = styled.div` margin: 12px 0; `; -const Input = styled(Flex)` +const HeaderInput = styled(Flex)` position: sticky; z-index: 1; top: 0; diff --git a/app/components/WebsocketProvider.tsx b/app/components/WebsocketProvider.tsx index eb235109ee..9da90d4da9 100644 --- a/app/components/WebsocketProvider.tsx +++ b/app/components/WebsocketProvider.tsx @@ -267,7 +267,7 @@ class WebsocketProvider extends React.Component { } if (event.userId) { - userMemberships.revoke({ + userMemberships.removeAll({ userId: event.userId, documentId: event.documentId, }); diff --git a/shared/i18n/locales/en_US/translation.json b/shared/i18n/locales/en_US/translation.json index 9edf479ba9..67d464a329 100644 --- a/shared/i18n/locales/en_US/translation.json +++ b/shared/i18n/locales/en_US/translation.json @@ -259,8 +259,8 @@ "Anyone with the link can access": "Anyone with the link can access", "Publish to internet": "Publish to internet", "{{ userName }} was invited to the document": "{{ userName }} was invited to the document", - "Invite by name": "Invite by name", "Done": "Done", + "Invite by name": "Invite by name", "No matches": "No matches", "All members": "All members", "Everyone in the workspace": "Everyone in the workspace",