Comments (5)
Can you show your full code? Whatever components you have inside of UploadField
will be clickable as a file input:
import { UploadField } from '@navjobs/upload'
<UploadField
onFiles={files => //files object here}
containerProps={{
className: 'resume_import'
}}
uploadProps={{
accept: '.pdf,.doc,.docx,.txt,.rtf',
}}
>
<div>
Click here to upload! This can be an image,
or any component you can dream of.
</div>
</UploadField>
The div inside will be clickable everywhere. You should only place it around what you want clickable.
from cj-upload.
Here's the code.
<UploadField
onFiles={([file]) => importXlsx(file)}
uploadProps={{ accept: '.xlsx,.csv' }}
containerProps={{ style: { boxShadow: '0px 1px 5px 0px rgba(0, 0, 0, 0.2), 0px 2px 2px 0px rgba(0, 0, 0, 0.14), 0px 3px 1px -2px rgba(0, 0, 0, 0.12)' } }}
>
<Button raised={true} onClick={() => console.log('ciao')}>Import</Button>
</UploadField>
The button is rendered ok, here the screen with the computed final styles (input full screen, button is ok):
from cj-upload.
Ah, I think I see. The upload field spans 100% height and width. You need to wrap it inside of something that is constrained to the height and width of your button. So like:
<div style={{width: '50px', height: '50px'}}>
<UploadField
onFiles={files => //files object here}
containerProps={{
className: 'resume_import'
}}
uploadProps={{
accept: '.pdf,.doc,.docx,.txt,.rtf',
}}
>
<div>
Click here to upload! This can be an image,
or any component you can dream of.
</div>
</UploadField>
</div>
from cj-upload.
Doh!
from cj-upload.
Let me know if you need any more help, I'll close this :)
from cj-upload.
Related Issues (20)
- Support multiple files at once HOT 3
- Return failed if response code is 500, not complete HOT 1
- onFiles never called. HOT 10
- Is there a function that gets called when the user hits cancel? HOT 5
- Progress value from 0 to 1? Or from 0 to 100? HOT 1
- how to clear the selected files? HOT 1
- Reset uploader state HOT 15
- TypeError: instance is not a function HOT 3
- UploadRequest resolves with error for 2xx status codes other then 200 and 201 HOT 2
- React 16 Upgrade HOT 1
- Upload twice same file do not trigger upload HOT 9
- How to limit the size of uploaded files? HOT 1
- Access the input ref HOT 2
- Unable to catch error response details HOT 2
- Support multiple files and returning a list of states
- fileName will never be null
- Reset the files array and progress if upload fails
- How to get files before upload? HOT 4
- Unable to get header values while using UploadRequest to upload file. HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from cj-upload.