From 72cd0ff8df930b37ff78aa1d55e87531bbec2071 Mon Sep 17 00:00:00 2001 From: Jackson Harper Date: Tue, 22 Nov 2022 13:00:37 +0800 Subject: [PATCH] Put the drag and drop style in a container so it can be centred --- .../templates/homeFeed/HomeFeedContainer.tsx | 110 ++++++++++-------- 1 file changed, 63 insertions(+), 47 deletions(-) diff --git a/packages/web/components/templates/homeFeed/HomeFeedContainer.tsx b/packages/web/components/templates/homeFeed/HomeFeedContainer.tsx index e5811ab1d..f3eb9a768 100644 --- a/packages/web/components/templates/homeFeed/HomeFeedContainer.tsx +++ b/packages/web/components/templates/homeFeed/HomeFeedContainer.tsx @@ -695,18 +695,31 @@ function HomeFeedGrid(props: HomeFeedContentProps): JSX.Element { }, }) - const DragnDropStyle = styled('div', { - border: '3px dashed gray', - backgroundColor: 'aliceblue', - borderRadius: '5px', - width: '95%', + const DragnDropContainer = styled('div', { + width: '100%', height: '80%', position: 'absolute', - opacity: '0.9', display: 'flex', justifyContent: 'center', alignItems: 'center', zIndex: '1', + alignSelf: 'center', + left: 0, + }) + + const DragnDropStyle = styled('div', { + border: '3px dashed gray', + backgroundColor: 'aliceblue', + borderRadius: '5px', + width: '100%', + height: '100%', + opacity: '0.9', + display: 'flex', + justifyContent: 'center', + alignItems: 'center', + alignSelf: 'center', + left: 0, + margin: '16px', }) const removeItem = () => { @@ -900,50 +913,53 @@ function HomeFeedGrid(props: HomeFeedContentProps): JSX.Element { {({ getRootProps, getInputProps, acceptedFiles, fileRejections }) => (
{inDragOperation && uploadingFiles.length < 1 && ( - - - Drag PDF document to this area to upload and add to your - library - - - )} - {uploadingFiles.length > 0 && ( - - - - - - + + - Uploading file - - - + Drop PDF document to to upload and add to your library + + + + )} + {uploadingFiles.length > 0 && ( + + + + + + + + Uploading file + + + + )} {!props.isValidating && props.items.length == 0 ? (