Hide collection header share button on mobile (no space, available in ...)

This commit is contained in:
Tom Moor
2024-05-31 18:21:55 -04:00
parent da19054555
commit 715b2b1b3f
3 changed files with 12 additions and 1 deletions

View File

@@ -8,6 +8,7 @@ import Button from "~/components/Button";
import Popover from "~/components/Popover";
import SharePopover from "~/components/Sharing/Collection/SharePopover";
import useCurrentTeam from "~/hooks/useCurrentTeam";
import useMobile from "~/hooks/useMobile";
import useStores from "~/hooks/useStores";
type Props = {
@@ -28,6 +29,10 @@ function ShareButton({ collection }: Props) {
placement: "bottom-end",
unstable_fixed: true,
});
const isMobile = useMobile();
if (isMobile) {
return null;
}
const icon = isPubliclyShared ? (
<GlobeIcon />

View File

@@ -259,7 +259,7 @@ function DocumentHeader({
/>
</Action>
)}
{!isEditing && !isRevision && !isMobile && can.update && (
{!isEditing && !isRevision && can.update && (
<Action>
<ShareButton document={document} />
</Action>

View File

@@ -8,6 +8,7 @@ import Button from "~/components/Button";
import Popover from "~/components/Popover";
import SharePopover from "~/components/Sharing/Document";
import useCurrentTeam from "~/hooks/useCurrentTeam";
import useMobile from "~/hooks/useMobile";
import useStores from "~/hooks/useStores";
type Props = {
@@ -33,6 +34,11 @@ function ShareButton({ document }: Props) {
unstable_fixed: true,
});
const isMobile = useMobile();
if (isMobile) {
return null;
}
const icon = isPubliclyShared ? <GlobeIcon /> : undefined;
return (