From 416238db29ad7f3888589f4f555cddaf332db52e Mon Sep 17 00:00:00 2001 From: Rafael Date: Tue, 1 Feb 2022 17:20:55 -0300 Subject: [PATCH] Switch some file action buttons to menuItems So everything can fit better on mobile view --- ui/component/fileActions/view.jsx | 46 ++++++++++++++++++++++++++++--- 1 file changed, 42 insertions(+), 4 deletions(-) diff --git a/ui/component/fileActions/view.jsx b/ui/component/fileActions/view.jsx index 2438a6305..adf0eee1c 100644 --- a/ui/component/fileActions/view.jsx +++ b/ui/component/fileActions/view.jsx @@ -1,4 +1,5 @@ // @flow +import { useIsMobile } from 'effects/use-screensize'; import { SITE_NAME, ENABLE_FILE_REACTIONS } from 'config'; import * as PAGES from 'constants/pages'; import * as MODALS from 'constants/modal_types'; @@ -60,6 +61,8 @@ export default function FileActions(props: Props) { location: { pathname, search }, } = useHistory(); + const isMobile = useIsMobile(); + const [downloadClicked, setDownloadClicked] = React.useState(false); const { claim_id: claimId, signing_channel: signingChannel, value, meta: claimMeta } = claim; @@ -108,7 +111,6 @@ export default function FileActions(props: Props) { push(`/$/${PAGES.REPOST_NEW}?from=${encodeURIComponent(uri)}&redirect=${encodeURIComponent(pathname)}`); } } - return (
{ENABLE_FILE_REACTIONS && } @@ -117,7 +119,7 @@ export default function FileActions(props: Props) { - {!hideRepost && ( + {!hideRepost && !isMobile && (