Coder Social home page Coder Social logo

Comments (5)

zackify avatar zackify commented on May 18, 2024

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.

damianobarbati avatar damianobarbati commented on May 18, 2024

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):
screen shot 2017-08-04 at 15 13 56
screen shot 2017-08-04 at 15 14 06

from cj-upload.

zackify avatar zackify commented on May 18, 2024

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.

damianobarbati avatar damianobarbati commented on May 18, 2024

Doh!

from cj-upload.

zackify avatar zackify commented on May 18, 2024

Let me know if you need any more help, I'll close this :)

from cj-upload.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.