siam-ui-utils 2.1.5 → 2.1.7
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/index.d.ts +1 -1
- package/package.json +1 -1
- package/src/index.js +1 -1
- package/src/tomar-foto/index.jsx +61 -61
package/index.d.ts
CHANGED
package/package.json
CHANGED
package/src/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export { DropzoneUploader } from './dropzone-uploader';
|
|
1
|
+
// export { DropzoneUploader } from './dropzone-uploader';
|
|
2
2
|
export { withRouter } from './bridges';
|
|
3
3
|
export { Colxx, Separator } from './CustomBootstrap';
|
|
4
4
|
export { CustomSelectInput } from './CustomSelectInput';
|
package/src/tomar-foto/index.jsx
CHANGED
|
@@ -1,66 +1,66 @@
|
|
|
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, Colxx } from '../dropzone-uploader';
|
|
5
|
+
import { TAKE_PHOTO } from '../constants';
|
|
6
|
+
import imgHacerFoto from '../assets/img/take-photo.png';
|
|
7
7
|
|
|
8
8
|
export const TomarFoto = ({ onFilesSelectedSelfie, isMobile = false }) => {
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
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;
|
|
15
15
|
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
16
|
+
const handleFilesSelectedSelfie = (files) => {
|
|
17
|
+
setTotalFilesSelectedSelfie(files.length);
|
|
18
|
+
onFilesSelectedSelfie(files);
|
|
19
|
+
};
|
|
20
20
|
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
}
|
|
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
|
+
};
|