[Abhinav] | moved upload Button to gallery component
This commit is contained in:
parent
1fe714fb2a
commit
6b7b579197
3 changed files with 25 additions and 29 deletions
|
@ -1,22 +0,0 @@
|
|||
import React from 'react';
|
||||
import { Button } from 'react-bootstrap';
|
||||
import Dropzone from 'react-dropzone';
|
||||
|
||||
const UploadButton = () => {
|
||||
return (
|
||||
<Dropzone
|
||||
onDrop={(acceptedFiles) => {
|
||||
console.log(acceptedFiles);
|
||||
}}
|
||||
>
|
||||
{({ getRootProps, getInputProps }) => (
|
||||
<div {...getRootProps()}>
|
||||
<input {...getInputProps()} />
|
||||
<Button>Upload</Button>
|
||||
</div>
|
||||
)}
|
||||
</Dropzone>
|
||||
);
|
||||
};
|
||||
|
||||
export default UploadButton;
|
|
@ -13,7 +13,7 @@ import Head from 'next/head';
|
|||
import 'bootstrap/dist/css/bootstrap.min.css';
|
||||
import 'react-photoswipe/lib/photoswipe.css';
|
||||
import localForage from 'localforage';
|
||||
import UploadButton from 'components/UploadButton';
|
||||
import UploadButton from 'pages/gallery/components/UploadButton';
|
||||
|
||||
localForage.config({
|
||||
driver: localForage.INDEXEDDB,
|
||||
|
@ -137,12 +137,9 @@ export default function App({ Component, pageProps }) {
|
|||
{constants.COMPANY_NAME}
|
||||
</FlexContainer>
|
||||
{user && (
|
||||
<>
|
||||
<UploadButton />
|
||||
<Button variant='link' onClick={logout}>
|
||||
<PowerSettings />
|
||||
</Button>
|
||||
</>
|
||||
<Button variant='link' onClick={logout}>
|
||||
<PowerSettings />
|
||||
</Button>
|
||||
)}
|
||||
</Navbar>
|
||||
{loading ? (
|
||||
|
|
21
src/pages/gallery/components/UploadButton.tsx
Normal file
21
src/pages/gallery/components/UploadButton.tsx
Normal file
|
@ -0,0 +1,21 @@
|
|||
import CollectionSelector from 'pages/gallery/components/CollectionSelector';
|
||||
import React, { useRef } from 'react';
|
||||
import { Button } from 'react-bootstrap';
|
||||
import Dropzone from 'react-dropzone';
|
||||
|
||||
const UploadButton = ({ modalView, closeModal, showModal }) => {
|
||||
return (
|
||||
<>
|
||||
<Button variant='primary' onClick={showModal}>
|
||||
Upload New Photos
|
||||
</Button>
|
||||
<CollectionSelector
|
||||
modalView={modalView}
|
||||
closeModal={closeModal}
|
||||
showModal={showModal}
|
||||
/>
|
||||
</>
|
||||
);
|
||||
};
|
||||
|
||||
export default UploadButton;
|
Loading…
Add table
Reference in a new issue