Hide collection header share button on mobile (no space, available in ...)
This commit is contained in:
@@ -8,6 +8,7 @@ import Button from "~/components/Button";
|
|||||||
import Popover from "~/components/Popover";
|
import Popover from "~/components/Popover";
|
||||||
import SharePopover from "~/components/Sharing/Collection/SharePopover";
|
import SharePopover from "~/components/Sharing/Collection/SharePopover";
|
||||||
import useCurrentTeam from "~/hooks/useCurrentTeam";
|
import useCurrentTeam from "~/hooks/useCurrentTeam";
|
||||||
|
import useMobile from "~/hooks/useMobile";
|
||||||
import useStores from "~/hooks/useStores";
|
import useStores from "~/hooks/useStores";
|
||||||
|
|
||||||
type Props = {
|
type Props = {
|
||||||
@@ -28,6 +29,10 @@ function ShareButton({ collection }: Props) {
|
|||||||
placement: "bottom-end",
|
placement: "bottom-end",
|
||||||
unstable_fixed: true,
|
unstable_fixed: true,
|
||||||
});
|
});
|
||||||
|
const isMobile = useMobile();
|
||||||
|
if (isMobile) {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
const icon = isPubliclyShared ? (
|
const icon = isPubliclyShared ? (
|
||||||
<GlobeIcon />
|
<GlobeIcon />
|
||||||
|
|||||||
@@ -259,7 +259,7 @@ function DocumentHeader({
|
|||||||
/>
|
/>
|
||||||
</Action>
|
</Action>
|
||||||
)}
|
)}
|
||||||
{!isEditing && !isRevision && !isMobile && can.update && (
|
{!isEditing && !isRevision && can.update && (
|
||||||
<Action>
|
<Action>
|
||||||
<ShareButton document={document} />
|
<ShareButton document={document} />
|
||||||
</Action>
|
</Action>
|
||||||
|
|||||||
@@ -8,6 +8,7 @@ import Button from "~/components/Button";
|
|||||||
import Popover from "~/components/Popover";
|
import Popover from "~/components/Popover";
|
||||||
import SharePopover from "~/components/Sharing/Document";
|
import SharePopover from "~/components/Sharing/Document";
|
||||||
import useCurrentTeam from "~/hooks/useCurrentTeam";
|
import useCurrentTeam from "~/hooks/useCurrentTeam";
|
||||||
|
import useMobile from "~/hooks/useMobile";
|
||||||
import useStores from "~/hooks/useStores";
|
import useStores from "~/hooks/useStores";
|
||||||
|
|
||||||
type Props = {
|
type Props = {
|
||||||
@@ -33,6 +34,11 @@ function ShareButton({ document }: Props) {
|
|||||||
unstable_fixed: true,
|
unstable_fixed: true,
|
||||||
});
|
});
|
||||||
|
|
||||||
|
const isMobile = useMobile();
|
||||||
|
if (isMobile) {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
const icon = isPubliclyShared ? <GlobeIcon /> : undefined;
|
const icon = isPubliclyShared ? <GlobeIcon /> : undefined;
|
||||||
|
|
||||||
return (
|
return (
|
||||||
|
|||||||
Reference in New Issue
Block a user