This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import React from 'react' | |
import idleSrc from './images/jade_input_bg.jpg' | |
import pendingSrc from './images/art-arts-and-crafts-bright-1124884.jpg' | |
import uploadedSrc from './images/adventure-background-blur-891252.jpg' | |
import errorSrc from './images/121911.jpg' | |
const Init = () => ( | |
<div style={{ textAlign: 'center' }}> | |
<h2>Upload Files</h2> | |
<small>Click here to select your files</small> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
.brightness100 { | |
filter: brightness(100%); | |
} | |
.brightness75 { | |
filter: brightness(75%); | |
} | |
.brightness50 { | |
filter: brightness(50%); | |
} | |
.opacity05 { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const FileUploaderScreen = ({ status }) => { | |
let src | |
switch (status) { | |
case 'IDLE': | |
src = idleSrc | |
break | |
case 'LOADED': | |
case 'PENDING': | |
src = pendingSrc | |
break |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import React from 'react' | |
import cx from 'classnames' | |
import FileUploader from './FileUploader' | |
import fileUploadBg from './images/jade_input_bg.jpg' | |
import Spinner from './Spinner' | |
import artsCrafts from './images/art-arts-and-crafts-bright-1124884.jpg' | |
import adventureBeginsBg from './images/adventure-background-blur-891252.jpg' | |
import errorSrc from './images/121911.jpg' | |
const Init = () => ( |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
.loaded { | |
text-align: center; | |
} | |
.loaded h2 { | |
margin: 0; | |
} | |
.loaded-actions { | |
display: flex; | |
justify-content: center; | |
align-items: center; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import React from 'react' | |
import useApp from './useApp' | |
import FileUploader from './FileUploader' | |
import FileUploaderScreen from './FileUploaderScreen' | |
import FileRow from './FileRow' | |
import './styles.css' | |
const App = ({ children }) => { | |
const inputRef = React.createRef() | |
const { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import React from 'react' | |
import useApp from './useApp' | |
import FileUploader from './FileUploader' | |
import FileUploaderScreen from './FileUploaderScreen' | |
import FileRow from './FileRow' | |
import './styles.css' | |
const App = ({ children }) => { | |
const inputRef = React.createRef() | |
const { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const getFileUploaderProps = (opts) => ({ | |
inputRef, | |
triggerInput, | |
onChange, | |
status: state.status, | |
...opts, | |
}) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const initialFileUploaderProps = getFileUploaderProps({ | |
triggerInput: status === 'IDLE' ? triggerInput : undefined, | |
onChange: status === 'IDLE' ? onChange : undefined, | |
}) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<FileUploader {...initialFileUploaderProps}> | |
<FileUploaderScreen | |
triggerInput={triggerInput} | |
getFileUploaderProps={getFileUploaderProps} | |
files={files} | |
pending={pending} | |
status={status} | |
/> | |
</FileUploader> |