From 8698040e6b5ab4e3505bfe92a2e18332ee48d9bc Mon Sep 17 00:00:00 2001 From: Aminejv Date: Fri, 19 Nov 2021 13:36:37 +0100 Subject: [PATCH] feat(ObjectPreview): pass isMobile props --- components/core/DataView.js | 1 + components/core/Filter/Content.js | 12 +++++++++--- components/core/ObjectPreview/LinkObjectPreview.js | 2 +- components/core/Upload/Popup.js | 7 +++---- components/core/Upload/index.js | 4 ++-- scenes/SceneFilesFolder.js | 1 - 6 files changed, 16 insertions(+), 11 deletions(-) diff --git a/components/core/DataView.js b/components/core/DataView.js index ccfc526a..72d18185 100644 --- a/components/core/DataView.js +++ b/components/core/DataView.js @@ -858,6 +858,7 @@ export default class DataView extends React.Component { onAction={this.props.onAction} isOwner={this.props.isOwner} isSelected={i in this.state.checked} + isMobile={this.props.isMobile} /> {numChecked || this.state.hover === i || this.state.menu === each.id ? ( diff --git a/components/core/Filter/Content.js b/components/core/Filter/Content.js index 3f727705..480e40da 100644 --- a/components/core/Filter/Content.js +++ b/components/core/Filter/Content.js @@ -16,7 +16,7 @@ const STYLES_DATAVIEWER_WRAPPER = (theme) => css` min-height: 100vh; padding: calc(20px + ${theme.sizes.filterNavbar}px) 24px 44px; @media (max-width: ${theme.sizes.mobile}px) { - padding: 31px 16px 44px; + padding: calc(31px + ${theme.sizes.filterNavbar}px) 16px 44px; } `; @@ -36,7 +36,7 @@ const STYLES_UPLOAD_BUTTON = (theme) => css` box-shadow: ${theme.shadow.lightSmall}; `; -export function Content({ viewer, onAction, page, ...props }) { +export function Content({ viewer, onAction, isMobile, page, ...props }) { const [{ filterState }] = useFilterContext(); const { objects } = filterState; @@ -49,7 +49,12 @@ export function Content({ viewer, onAction, page, ...props }) { return (
{objects.length > 0 ? ( - + diff --git a/components/core/ObjectPreview/LinkObjectPreview.js b/components/core/ObjectPreview/LinkObjectPreview.js index 219ced59..a4c41960 100644 --- a/components/core/ObjectPreview/LinkObjectPreview.js +++ b/components/core/ObjectPreview/LinkObjectPreview.js @@ -75,7 +75,7 @@ export default function LinkObjectPreview({ file, ratio, ...props }) { href={file.url} target="_blank" rel="noreferrer" - style={{ position: "relative", zIndex: 2 }} + style={{ position: "relative" }} onClick={(e) => e.stopPropagation()} >
diff --git a/components/core/Upload/Popup.js b/components/core/Upload/Popup.js index 783733ae..71e0a438 100644 --- a/components/core/Upload/Popup.js +++ b/components/core/Upload/Popup.js @@ -28,7 +28,6 @@ const STYLES_POPUP_WRAPPER = (theme) => css` z-index: ${theme.zindex.tooltip}; @media (max-width: ${theme.sizes.mobile}px) { right: 50%; - transform: translateX(50%); } `; @@ -164,7 +163,7 @@ const useUploadSummary = ({ fileLoading }) => }; }, [fileLoading]); -export function Popup() { +export function Popup({ isMobile }) { const { state: { isFinished, fileLoading }, handlers: { resetUploadState }, @@ -184,7 +183,7 @@ export function Popup() { {popupState.isVisible ? (
- +