浏览代码

Merge branch 'master' into handle-B2-errors

Abhinav-grd 4 年之前
父节点
当前提交
afd3895ee3

+ 1 - 9
src/components/FullScreenDropZone.tsx

@@ -9,13 +9,11 @@ const DropDiv = styled.div`
 
 type Props = React.PropsWithChildren<{
     showModal: () => void;
-    closeModal: () => void;
 }>;
 
 export default function FullScreenDropZone({
     children,
     showModal,
-    closeModal,
 }: Props) {
     const closeTimer = useRef<NodeJS.Timeout>();
 
@@ -31,14 +29,8 @@ export default function FullScreenDropZone({
         showModal();
     };
 
-    const onDragLeave = (e) => {
-        e.preventDefault();
-        clearTimer();
-        closeTimer.current = global.setTimeout(closeModal, 1000);
-    };
-
     return (
-        <DropDiv onDragOver={onDragOver} onDragLeave={onDragLeave}>
+        <DropDiv onDragOver={onDragOver}>
             {children}
         </DropDiv>
     );

+ 0 - 1
src/pages/_app.tsx

@@ -190,7 +190,6 @@ export default function App({ Component, pageProps }) {
 
     return (
         <FullScreenDropZone
-            closeModal={closeUploadModal}
             showModal={showUploadModal}
         >
             <Head>

+ 1 - 0
src/pages/gallery/components/AddCollection.tsx

@@ -16,6 +16,7 @@ const ImageContainer = styled.div`
 `;
 
 const StyledCard = styled(Card)`
+    border-radius: 30px !important;
     cursor: pointer;
 `;
 

+ 0 - 2
src/pages/gallery/components/CollectionDropZone.tsx

@@ -6,7 +6,6 @@ import DropzoneWrapper from './DropzoneWrapper';
 function CollectionDropZone({
     children,
     closeModal,
-    showModal,
     refetchData,
     collectionAndItsLatestFile,
     setProgressView,
@@ -39,7 +38,6 @@ function CollectionDropZone({
         <DropzoneWrapper
             children={children}
             onDropAccepted={upload}
-            onDragOver={showModal}
             onDropRejected={closeModal}
         />
     );

+ 1 - 1
src/pages/gallery/components/CollectionSelector.tsx

@@ -21,7 +21,7 @@ function CollectionSelector(props) {
                 showModal={showUploadModal}
                 collectionAndItsLatestFile={item}
             >
-                <Card>
+                <Card style={{ borderRadius: '30px' }}>
                     <PreviewCard
                         data={item.file}
                         updateUrl={() => { }}

+ 5 - 4
src/pages/gallery/components/DropzoneWrapper.tsx

@@ -14,15 +14,16 @@ export const getColor = (props) => {
     }
 };
 
-export const enableBorder = (props) => (props.isDragActive ? 'dashed' : 'none');
+export const enableBorder = (props) => (props.isDragActive ? 'solid' : 'none');
 
 export const DropDiv = styled.div`
     width: 200px;
     margin: 5px;
-    height: 230px;
+    height: 240px;
+    padding: 4px;
     color: black;
-    border-width: 2px;
-    border-radius: 2px;
+    border-width: 4px;
+    border-radius: 34px;
     border-color: ${(props) => getColor(props)};
     border-style: ${(props) => enableBorder(props)};
     outline: none;

+ 1 - 0
src/pages/index.tsx

@@ -97,6 +97,7 @@ export default function Home() {
                                             isInvalid={Boolean(
                                                 touched.email && errors.email
                                             )}
+                                            autoFocus={true}
                                             disabled={loading}
                                         />
                                         <FormControl.Feedback type="invalid">