The code powering m.abunchtell.com https://m.abunchtell.com
Nevar pievienot vairāk kā 25 tēmas Tēmai ir jāsākas ar burtu vai ciparu, tā var saturēt domu zīmes ('-') un var būt līdz 35 simboliem gara.
 
 
 
 

31 rinda
1.1 KiB

  1. import PropTypes from 'prop-types';
  2. import { Motion, spring } from 'react-motion';
  3. import { FormattedMessage } from 'react-intl';
  4. class UploadArea extends React.PureComponent {
  5. render () {
  6. const { active } = this.props;
  7. return (
  8. <Motion defaultStyle={{ backgroundOpacity: 0, backgroundScale: 0.95 }} style={{ backgroundOpacity: spring(active ? 1 : 0, { stiffness: 150, damping: 15 }), backgroundScale: spring(active ? 1 : 0.95, { stiffness: 200, damping: 3 }) }}>
  9. {({ backgroundOpacity, backgroundScale }) =>
  10. <div className='upload-area' style={{ visibility: active ? 'visible' : 'hidden', opacity: backgroundOpacity }}>
  11. <div className='upload-area__drop'>
  12. <div className='upload-area__background' style={{ transform: `translateZ(0) scale(${backgroundScale})` }} />
  13. <div className='upload-area__content'><FormattedMessage id='upload_area.title' defaultMessage='Drag & drop to upload' /></div>
  14. </div>
  15. </div>
  16. }
  17. </Motion>
  18. );
  19. }
  20. }
  21. UploadArea.propTypes = {
  22. active: PropTypes.bool
  23. };
  24. export default UploadArea;