Skip to content

Commit

Permalink
Made Dropzone loadable to get around gatsby build issues
Browse files Browse the repository at this point in the history
  • Loading branch information
Alex Dykstra authored and Alex Dykstra committed Nov 19, 2020
1 parent 47f2f11 commit dd75270
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 4 deletions.
4 changes: 2 additions & 2 deletions src/components/Dropzone.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import untar from "js-untar";
const pako = require('pako');
var JSZip = require("jszip");

const FileDropzone = ({setZipList}) => {
const Dropzone = ({setZipList}) => {

async function getZipFilesContent (data) {
const zipContent = []
Expand Down Expand Up @@ -80,4 +80,4 @@ const FileDropzone = ({setZipList}) => {
)
}

export default FileDropzone
export default Dropzone
12 changes: 12 additions & 0 deletions src/components/LoadableDropzone.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
import React from 'react'
import loadable from '@loadable/component'

const Dropzone = loadable(() => import('./Dropzone'))

const LoadableDropzone = ({setZipList}) => {
return (
<Dropzone setZipList={setZipList}></Dropzone>
)
}

export default LoadableDropzone
4 changes: 2 additions & 2 deletions src/pages/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import {
NavbarHeading,
NavbarDivider
} from "@blueprintjs/core";
import FileDropzone from '../components/Dropzone'
import LoadableDropzone from '../components/LoadableDropzone'
import LoadableLogViewer from '../components/LoadableLogViewer';

export default function Index() {
Expand All @@ -25,7 +25,7 @@ export default function Index() {
<NavbarGroup align={Alignment.LEFT}>
<NavbarHeading>Log Parser</NavbarHeading>
<NavbarDivider />
<FileDropzone setZipList={setLogList}></FileDropzone>
<LoadableDropzone setZipList={setLogList}></LoadableDropzone>
</NavbarGroup>
<Navbar.Group align={Alignment.RIGHT}>
<Button icon="refresh" className="bp3-minimal" intent="danger" text="Clear" onClick={resetApp}/>
Expand Down

0 comments on commit dd75270

Please sign in to comment.