siam-ui-utils 2.1.6 → 2.1.8

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "siam-ui-utils",
3
- "version": "2.1.6",
3
+ "version": "2.1.8",
4
4
  "keywords": [
5
5
  "ampf-react",
6
6
  "ampf-utils",
@@ -1,66 +1,67 @@
1
1
  /* eslint-disable react/prop-types */
2
- import React, { useState } from 'react'
3
- import { Row } from 'reactstrap'
4
- import { DropzoneUploader, Colxx } from '../'
5
- import { TAKE_PHOTO } from '../constants'
6
- import imgHacerFoto from '../assets/img/take-photo.png'
2
+ import React, { useState } from 'react';
3
+ import { Row } from 'reactstrap';
4
+ import { DropzoneUploader } from '../dropzone-uploader';
5
+ import { Colxx } from '../CustomBootstrap';
6
+ import { TAKE_PHOTO } from '../constants';
7
+ import imgHacerFoto from '../assets/img/take-photo.png';
7
8
 
8
9
  export const TomarFoto = ({ onFilesSelectedSelfie, isMobile = false }) => {
9
- const [filesTotalSelectedSelfie, setTotalFilesSelectedSelfie] = useState(0)
10
- const {
11
- LOAD_SELFIE_WITH_IDENTITY_CARD_MESSAGE,
12
- MESSAGE_SELFIE_ONLY_CAN_TAKE_FROM_CELLPHONE,
13
- TAKE_PHOTO_MESSAGE,
14
- } = TAKE_PHOTO
10
+ const [filesTotalSelectedSelfie, setTotalFilesSelectedSelfie] = useState(0);
11
+ const {
12
+ LOAD_SELFIE_WITH_IDENTITY_CARD_MESSAGE,
13
+ MESSAGE_SELFIE_ONLY_CAN_TAKE_FROM_CELLPHONE,
14
+ TAKE_PHOTO_MESSAGE,
15
+ } = TAKE_PHOTO;
15
16
 
16
- const handleFilesSelectedSelfie = (files) => {
17
- setTotalFilesSelectedSelfie(files.length)
18
- onFilesSelectedSelfie(files)
19
- }
17
+ const handleFilesSelectedSelfie = (files) => {
18
+ setTotalFilesSelectedSelfie(files.length);
19
+ onFilesSelectedSelfie(files);
20
+ };
20
21
 
21
- return (
22
- <>
23
- <Row className='pt-2 ml-4'>
24
- <Colxx xxs='11' md='5'>
25
- {LOAD_SELFIE_WITH_IDENTITY_CARD_MESSAGE}
26
- </Colxx>
27
- </Row>
28
- <Row className='pt-2 ml-2'>
29
- <Colxx xxs='12' md='9'>
30
- {isMobile ? (
31
- <>
32
- <Colxx xxs='12' className='text-center'>
33
- {filesTotalSelectedSelfie === 0 && (
34
- <img
35
- style={{ width: '97%' }}
36
- alt='hacerFotoDNI'
37
- src={imgHacerFoto}
38
- />
39
- )}
40
- <DropzoneUploader
41
- className='pt-2 ml-2'
42
- maxFiles={1}
43
- onChangeFiles={handleFilesSelectedSelfie}
44
- totalFiles={filesTotalSelectedSelfie}
45
- accept='image/jpg,image/jpeg'
46
- capture='environment'
47
- nameFileLabel={TAKE_PHOTO_MESSAGE}
48
- />
49
- </Colxx>
50
- </>
51
- ) : (
52
- <h2
53
- className={'view-icon iconsminds-smartphone-4 ml-2 mr-2'}
54
- style={{
55
- color: 'red',
56
- margin: '10px 10px 0px 10px',
57
- }}
58
- >
59
- {MESSAGE_SELFIE_ONLY_CAN_TAKE_FROM_CELLPHONE}
60
- </h2>
61
- )}
62
- </Colxx>
63
- </Row>
64
- </>
65
- )
66
- }
22
+ return (
23
+ <>
24
+ <Row className="pt-2 ml-4">
25
+ <Colxx xxs="11" md="5">
26
+ {LOAD_SELFIE_WITH_IDENTITY_CARD_MESSAGE}
27
+ </Colxx>
28
+ </Row>
29
+ <Row className="pt-2 ml-2">
30
+ <Colxx xxs="12" md="9">
31
+ {isMobile ? (
32
+ <>
33
+ <Colxx xxs="12" className="text-center">
34
+ {filesTotalSelectedSelfie === 0 && (
35
+ <img
36
+ style={{ width: '97%' }}
37
+ alt="hacerFotoDNI"
38
+ src={imgHacerFoto}
39
+ />
40
+ )}
41
+ <DropzoneUploader
42
+ className="pt-2 ml-2"
43
+ maxFiles={1}
44
+ onChangeFiles={handleFilesSelectedSelfie}
45
+ totalFiles={filesTotalSelectedSelfie}
46
+ accept="image/jpg,image/jpeg"
47
+ capture="environment"
48
+ nameFileLabel={TAKE_PHOTO_MESSAGE}
49
+ />
50
+ </Colxx>
51
+ </>
52
+ ) : (
53
+ <h2
54
+ className={'view-icon iconsminds-smartphone-4 ml-2 mr-2'}
55
+ style={{
56
+ color: 'red',
57
+ margin: '10px 10px 0px 10px',
58
+ }}
59
+ >
60
+ {MESSAGE_SELFIE_ONLY_CAN_TAKE_FROM_CELLPHONE}
61
+ </h2>
62
+ )}
63
+ </Colxx>
64
+ </Row>
65
+ </>
66
+ );
67
+ };