react-native-exp-fig 0.1.29 → 0.1.31
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/lib/commonjs/components/modals/modal-activities/data-activities/index.js +34 -13
- package/lib/commonjs/components/modals/modal-activities/data-activities/index.js.map +1 -1
- package/lib/commonjs/components/modals/modal-activities/helpers/index.js +30 -0
- package/lib/commonjs/components/modals/modal-activities/helpers/index.js.map +1 -0
- package/lib/commonjs/components/modals/modal-activities/index.js +5 -4
- package/lib/commonjs/components/modals/modal-activities/index.js.map +1 -1
- package/lib/commonjs/components/modals/modal-activities/interface.d.js.map +1 -1
- package/lib/commonjs/components/selects/select-option/styles.js +10 -7
- package/lib/commonjs/components/selects/select-option/styles.js.map +1 -1
- package/lib/module/components/modals/modal-activities/data-activities/index.js +33 -12
- package/lib/module/components/modals/modal-activities/data-activities/index.js.map +1 -1
- package/lib/module/components/modals/modal-activities/helpers/index.js +24 -0
- package/lib/module/components/modals/modal-activities/helpers/index.js.map +1 -0
- package/lib/module/components/modals/modal-activities/index.js +5 -4
- package/lib/module/components/modals/modal-activities/index.js.map +1 -1
- package/lib/module/components/modals/modal-activities/interface.d.js.map +1 -1
- package/lib/module/components/selects/select-option/styles.js +10 -7
- package/lib/module/components/selects/select-option/styles.js.map +1 -1
- package/lib/typescript/src/components/modals/modal-activities/data-activities/index.d.ts +12 -17
- package/lib/typescript/src/components/modals/modal-activities/helpers/index.d.ts +11 -0
- package/lib/typescript/src/components/selects/select-option/styles.d.ts +6 -3
- package/package.json +1 -1
- package/src/components/modals/modal-activities/data-activities/index.ts +95 -65
- package/src/components/modals/modal-activities/helpers/index.ts +25 -0
- package/src/components/modals/modal-activities/index.tsx +138 -137
- package/src/components/modals/modal-activities/interface.d.ts +34 -32
- package/src/components/selects/select-option/styles.ts +78 -75
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["StyleSheet","theme","styles","props","_props$sizeTitleLabel","_props$colortitleLabe","create","container","width","marginBottom","label","fontSize","sizeTitleLabel","fontWeight","color","colortitleLabel","colors","black","selectBox","flexDirection","alignItems","justifyContent","height","borderWidth","borderColor","gray","borderRadius","backgroundColor","neutral","paddingHorizontal","selectedText","modalOverlay","flex","padding","modalContainer","option","borderBottomWidth","borderBottomColor","optionText","closeButtonText"],"sources":["styles.ts"],"sourcesContent":["/**\n * IMPORTS\n */\nimport { StyleSheet } from \"react-native\";\n\n// typings\nimport { ISelectDropDownProps } from \"./interface\";\n\n// theme\nimport { theme } from \"../../../styles/theme/theme\";\n\nconst styles = (props: ISelectDropDownProps) =>\n StyleSheet.create({\n container: {\n width: \"100%\",\n marginBottom: 16,\n },\n label: {\n fontSize: props.sizeTitleLabel ?? 16,\n fontWeight: \"bold\",\n color: props.colortitleLabel ?? theme.colors.black[100],\n marginBottom: 5,\n },\n selectBox: {\n flexDirection: \"row\",\n alignItems: \"center\",\n justifyContent: \"space-between\",\n width: \"100%\",\n height: 45,\n borderWidth: 1,\n borderColor: theme.colors.gray[700],\n borderRadius: 10,\n backgroundColor: theme.colors.neutral[25],\n paddingHorizontal: 10,\n },\n selectedText: {\n fontSize: 14,\n color: \"#666\",\n },\n modalOverlay: {\n flex: 1,\n backgroundColor: \"rgba(0,0,0,0.5)\",\n justifyContent: \"center\",\n alignItems: \"center\",\n padding: 24,\n },\n modalContainer: {\n width: \"100%\",\n backgroundColor: theme.colors.neutral[25],\n borderRadius: 10,\n
|
|
1
|
+
{"version":3,"names":["StyleSheet","theme","styles","props","_props$sizeTitleLabel","_props$colortitleLabe","create","container","width","marginBottom","label","fontSize","sizeTitleLabel","fontWeight","color","colortitleLabel","colors","black","selectBox","flexDirection","alignItems","justifyContent","height","borderWidth","borderColor","gray","borderRadius","backgroundColor","neutral","paddingHorizontal","selectedText","modalOverlay","flex","padding","modalContainer","paddingVertical","option","paddingRight","paddingLeft","borderBottomWidth","borderBottomColor","optionText","closeButtonText"],"sources":["styles.ts"],"sourcesContent":["/**\r\n * IMPORTS\r\n */\r\nimport { StyleSheet } from \"react-native\";\r\n\r\n// typings\r\nimport { ISelectDropDownProps } from \"./interface\";\r\n\r\n// theme\r\nimport { theme } from \"../../../styles/theme/theme\";\r\n\r\nconst styles = (props: ISelectDropDownProps) =>\r\n StyleSheet.create({\r\n container: {\r\n width: \"100%\",\r\n marginBottom: 16,\r\n },\r\n label: {\r\n fontSize: props.sizeTitleLabel ?? 16,\r\n fontWeight: \"bold\",\r\n color: props.colortitleLabel ?? theme.colors.black[100],\r\n marginBottom: 5,\r\n },\r\n selectBox: {\r\n flexDirection: \"row\",\r\n alignItems: \"center\",\r\n justifyContent: \"space-between\",\r\n width: \"100%\",\r\n height: 45,\r\n borderWidth: 1,\r\n borderColor: theme.colors.gray[700],\r\n borderRadius: 10,\r\n backgroundColor: theme.colors.neutral[25],\r\n paddingHorizontal: 10,\r\n },\r\n selectedText: {\r\n fontSize: 14,\r\n color: \"#666\",\r\n },\r\n modalOverlay: {\r\n flex: 1,\r\n backgroundColor: \"rgba(0,0,0,0.5)\",\r\n justifyContent: \"center\",\r\n alignItems: \"center\",\r\n padding: 24,\r\n },\r\n modalContainer: {\r\n width: \"100%\",\r\n backgroundColor: theme.colors.neutral[25],\r\n borderRadius: 10,\r\n paddingVertical: 15,\r\n paddingHorizontal: 20,\r\n alignItems: \"stretch\",\r\n },\r\n option: {\r\n width: \"100%\",\r\n paddingVertical: 10,\r\n paddingRight: 10,\r\n paddingLeft: 0,\r\n alignItems: \"flex-start\",\r\n borderBottomWidth: 1,\r\n borderBottomColor: theme.colors.gray[300],\r\n },\r\n optionText: {\r\n fontSize: 14,\r\n color: theme.colors.black[100],\r\n fontWeight: \"500\",\r\n },\r\n closeButtonText: {\r\n color: theme.colors.neutral[25],\r\n fontWeight: \"bold\",\r\n },\r\n });\r\n\r\n/**\r\n * EXPORTS\r\n */\r\nexport { styles };\r\n"],"mappings":"AAAA;AACA;AACA;AACA,SAASA,UAAU,QAAQ,cAAc;;AAEzC;;AAGA;AACA,SAASC,KAAK,QAAQ,6BAA6B;AAEnD,MAAMC,MAAM,GAAIC,KAA2B;EAAA,IAAAC,qBAAA,EAAAC,qBAAA;EAAA,OACzCL,UAAU,CAACM,MAAM,CAAC;IAChBC,SAAS,EAAE;MACTC,KAAK,EAAE,MAAM;MACbC,YAAY,EAAE;IAChB,CAAC;IACDC,KAAK,EAAE;MACLC,QAAQ,GAAAP,qBAAA,GAAED,KAAK,CAACS,cAAc,cAAAR,qBAAA,cAAAA,qBAAA,GAAI,EAAE;MACpCS,UAAU,EAAE,MAAM;MAClBC,KAAK,GAAAT,qBAAA,GAAEF,KAAK,CAACY,eAAe,cAAAV,qBAAA,cAAAA,qBAAA,GAAIJ,KAAK,CAACe,MAAM,CAACC,KAAK,CAAC,GAAG,CAAC;MACvDR,YAAY,EAAE;IAChB,CAAC;IACDS,SAAS,EAAE;MACTC,aAAa,EAAE,KAAK;MACpBC,UAAU,EAAE,QAAQ;MACpBC,cAAc,EAAE,eAAe;MAC/Bb,KAAK,EAAE,MAAM;MACbc,MAAM,EAAE,EAAE;MACVC,WAAW,EAAE,CAAC;MACdC,WAAW,EAAEvB,KAAK,CAACe,MAAM,CAACS,IAAI,CAAC,GAAG,CAAC;MACnCC,YAAY,EAAE,EAAE;MAChBC,eAAe,EAAE1B,KAAK,CAACe,MAAM,CAACY,OAAO,CAAC,EAAE,CAAC;MACzCC,iBAAiB,EAAE;IACrB,CAAC;IACDC,YAAY,EAAE;MACZnB,QAAQ,EAAE,EAAE;MACZG,KAAK,EAAE;IACT,CAAC;IACDiB,YAAY,EAAE;MACZC,IAAI,EAAE,CAAC;MACPL,eAAe,EAAE,iBAAiB;MAClCN,cAAc,EAAE,QAAQ;MACxBD,UAAU,EAAE,QAAQ;MACpBa,OAAO,EAAE;IACX,CAAC;IACDC,cAAc,EAAE;MACd1B,KAAK,EAAE,MAAM;MACbmB,eAAe,EAAE1B,KAAK,CAACe,MAAM,CAACY,OAAO,CAAC,EAAE,CAAC;MACzCF,YAAY,EAAE,EAAE;MAChBS,eAAe,EAAE,EAAE;MACnBN,iBAAiB,EAAE,EAAE;MACrBT,UAAU,EAAE;IACd,CAAC;IACDgB,MAAM,EAAE;MACN5B,KAAK,EAAE,MAAM;MACb2B,eAAe,EAAE,EAAE;MACnBE,YAAY,EAAE,EAAE;MAChBC,WAAW,EAAE,CAAC;MACdlB,UAAU,EAAE,YAAY;MACxBmB,iBAAiB,EAAE,CAAC;MACpBC,iBAAiB,EAAEvC,KAAK,CAACe,MAAM,CAACS,IAAI,CAAC,GAAG;IAC1C,CAAC;IACDgB,UAAU,EAAE;MACV9B,QAAQ,EAAE,EAAE;MACZG,KAAK,EAAEb,KAAK,CAACe,MAAM,CAACC,KAAK,CAAC,GAAG,CAAC;MAC9BJ,UAAU,EAAE;IACd,CAAC;IACD6B,eAAe,EAAE;MACf5B,KAAK,EAAEb,KAAK,CAACe,MAAM,CAACY,OAAO,CAAC,EAAE,CAAC;MAC/Bf,UAAU,EAAE;IACd;EACF,CAAC,CAAC;AAAA;;AAEJ;AACA;AACA;AACA,SAASX,MAAM","ignoreList":[]}
|
|
@@ -1,19 +1,14 @@
|
|
|
1
1
|
/**
|
|
2
|
-
*
|
|
2
|
+
* Tipagem da atividade
|
|
3
3
|
*/
|
|
4
|
-
export
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
cor_hex: string;
|
|
16
|
-
descricao: string;
|
|
17
|
-
tipo: string;
|
|
18
|
-
}[];
|
|
19
|
-
};
|
|
4
|
+
export interface IActivity {
|
|
5
|
+
id: number;
|
|
6
|
+
referencia: string;
|
|
7
|
+
cor_hex: string;
|
|
8
|
+
descricao: string;
|
|
9
|
+
tipo: "trabalho" | "descanso";
|
|
10
|
+
}
|
|
11
|
+
/**
|
|
12
|
+
* Atividades específicas por tipo de usuário
|
|
13
|
+
*/
|
|
14
|
+
export declare const activitiesByDriverType: Record<string, Record<string, IActivity[]>>;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Função que retorna as atividades por tipo de atividade e tipo de usuário (normal ou carregador)
|
|
3
|
+
* @param driverType
|
|
4
|
+
* @param activityType
|
|
5
|
+
* @returns
|
|
6
|
+
*/
|
|
7
|
+
declare const getActivitiesByType: (driverType: string, activityType: string) => import("../data-activities").IActivity[];
|
|
8
|
+
/**
|
|
9
|
+
* EXPORTS
|
|
10
|
+
*/
|
|
11
|
+
export { getActivitiesByType };
|
|
@@ -37,12 +37,15 @@ declare const styles: (props: ISelectDropDownProps) => {
|
|
|
37
37
|
width: "100%";
|
|
38
38
|
backgroundColor: string;
|
|
39
39
|
borderRadius: number;
|
|
40
|
-
|
|
41
|
-
|
|
40
|
+
paddingVertical: number;
|
|
41
|
+
paddingHorizontal: number;
|
|
42
|
+
alignItems: "stretch";
|
|
42
43
|
};
|
|
43
44
|
option: {
|
|
44
45
|
width: "100%";
|
|
45
|
-
|
|
46
|
+
paddingVertical: number;
|
|
47
|
+
paddingRight: number;
|
|
48
|
+
paddingLeft: number;
|
|
46
49
|
alignItems: "flex-start";
|
|
47
50
|
borderBottomWidth: number;
|
|
48
51
|
borderBottomColor: string;
|
package/package.json
CHANGED
|
@@ -1,65 +1,95 @@
|
|
|
1
|
-
/**
|
|
2
|
-
*
|
|
3
|
-
*/
|
|
4
|
-
export
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
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
|
-
|
|
1
|
+
/**
|
|
2
|
+
* Tipagem da atividade
|
|
3
|
+
*/
|
|
4
|
+
export interface IActivity {
|
|
5
|
+
id: number;
|
|
6
|
+
referencia: string;
|
|
7
|
+
cor_hex: string;
|
|
8
|
+
descricao: string;
|
|
9
|
+
tipo: "trabalho" | "descanso";
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
/**
|
|
13
|
+
* Lista base de atividades padrão (normal)
|
|
14
|
+
*/
|
|
15
|
+
const baseActivities: Record<string, IActivity[]> = {
|
|
16
|
+
trabalho: [
|
|
17
|
+
{
|
|
18
|
+
id: 1,
|
|
19
|
+
referencia: "operacao_veiculo",
|
|
20
|
+
cor_hex: "#000000",
|
|
21
|
+
descricao: "Operação com Veículo",
|
|
22
|
+
tipo: "trabalho",
|
|
23
|
+
},
|
|
24
|
+
{
|
|
25
|
+
id: 2,
|
|
26
|
+
referencia: "aguardando_carga",
|
|
27
|
+
cor_hex: "#000000",
|
|
28
|
+
descricao: "Em Carga",
|
|
29
|
+
tipo: "trabalho",
|
|
30
|
+
},
|
|
31
|
+
{
|
|
32
|
+
id: 3,
|
|
33
|
+
referencia: "aguardando_descarga",
|
|
34
|
+
cor_hex: "#000000",
|
|
35
|
+
descricao: "Em Descarga",
|
|
36
|
+
tipo: "trabalho",
|
|
37
|
+
},
|
|
38
|
+
{
|
|
39
|
+
id: 8,
|
|
40
|
+
referencia: "disposicao_veiculo_parado",
|
|
41
|
+
cor_hex: "#000000",
|
|
42
|
+
descricao: "Disposição com Veículo Parado",
|
|
43
|
+
tipo: "trabalho",
|
|
44
|
+
},
|
|
45
|
+
],
|
|
46
|
+
descanso: [
|
|
47
|
+
{
|
|
48
|
+
id: 5,
|
|
49
|
+
referencia: "repouso_semanal",
|
|
50
|
+
cor_hex: "#000000",
|
|
51
|
+
descricao: "Repouso Semanal",
|
|
52
|
+
tipo: "descanso",
|
|
53
|
+
},
|
|
54
|
+
{
|
|
55
|
+
id: 6,
|
|
56
|
+
referencia: "repouso_noturno",
|
|
57
|
+
cor_hex: "#000000",
|
|
58
|
+
descricao: "Repouso Noturno",
|
|
59
|
+
tipo: "descanso",
|
|
60
|
+
},
|
|
61
|
+
{
|
|
62
|
+
id: 7,
|
|
63
|
+
referencia: "refeicao",
|
|
64
|
+
cor_hex: "#000000",
|
|
65
|
+
descricao: "Refeição",
|
|
66
|
+
tipo: "descanso",
|
|
67
|
+
},
|
|
68
|
+
{
|
|
69
|
+
id: 9,
|
|
70
|
+
referencia: "descanso",
|
|
71
|
+
cor_hex: "#000000",
|
|
72
|
+
descricao: "Descanso",
|
|
73
|
+
tipo: "descanso",
|
|
74
|
+
},
|
|
75
|
+
],
|
|
76
|
+
};
|
|
77
|
+
|
|
78
|
+
/**
|
|
79
|
+
* Atividades específicas por tipo de usuário
|
|
80
|
+
*/
|
|
81
|
+
export const activitiesByDriverType: Record<string, Record<string, IActivity[]>> = {
|
|
82
|
+
normal: baseActivities,
|
|
83
|
+
carregador: {
|
|
84
|
+
trabalho: [
|
|
85
|
+
{
|
|
86
|
+
id: 1,
|
|
87
|
+
referencia: "operacao_veiculo",
|
|
88
|
+
cor_hex: "#000000",
|
|
89
|
+
descricao: "Operação com Veículo",
|
|
90
|
+
tipo: "trabalho",
|
|
91
|
+
},
|
|
92
|
+
],
|
|
93
|
+
descanso: baseActivities.descanso!,
|
|
94
|
+
},
|
|
95
|
+
};
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* IMPORTS
|
|
3
|
+
*/
|
|
4
|
+
import { activitiesByDriverType } from "../data-activities";
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* Função que retorna as atividades por tipo de atividade e tipo de usuário (normal ou carregador)
|
|
8
|
+
* @param driverType
|
|
9
|
+
* @param activityType
|
|
10
|
+
* @returns
|
|
11
|
+
*/
|
|
12
|
+
const getActivitiesByType = (driverType: string, activityType: string) => {
|
|
13
|
+
const driverActivities = activitiesByDriverType[driverType];
|
|
14
|
+
|
|
15
|
+
if (!driverActivities) {
|
|
16
|
+
return activitiesByDriverType["carregador"]![activityType] || [];
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
return driverActivities[activityType] || [];
|
|
20
|
+
};
|
|
21
|
+
|
|
22
|
+
/**
|
|
23
|
+
* EXPORTS
|
|
24
|
+
*/
|
|
25
|
+
export { getActivitiesByType };
|
|
@@ -1,137 +1,138 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* IMPORTS
|
|
3
|
-
*/
|
|
4
|
-
import React from "react";
|
|
5
|
-
import { Modal, TouchableOpacity, FlatList } from "react-native";
|
|
6
|
-
|
|
7
|
-
// components
|
|
8
|
-
|
|
9
|
-
import Box from "../../box";
|
|
10
|
-
|
|
11
|
-
// commons / icons
|
|
12
|
-
import { Icons } from "../../../common/icons-svg";
|
|
13
|
-
import { getIconModalActivities } from "../../../common/icons-svg/modal-activities";
|
|
14
|
-
|
|
15
|
-
// styles
|
|
16
|
-
import { theme } from "../../../styles/theme/theme";
|
|
17
|
-
import { Typography } from "../../typography";
|
|
18
|
-
import { Button } from "../../button";
|
|
19
|
-
|
|
20
|
-
//typing
|
|
21
|
-
import { IModalActivities, IActivity } from "./interface";
|
|
22
|
-
|
|
23
|
-
// atividades
|
|
24
|
-
import {
|
|
25
|
-
|
|
26
|
-
export const ModalActivities: React.FC<IModalActivities> = ({
|
|
27
|
-
onClose,
|
|
28
|
-
handleActivity,
|
|
29
|
-
activityType,
|
|
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
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
1
|
+
/**
|
|
2
|
+
* IMPORTS
|
|
3
|
+
*/
|
|
4
|
+
import React from "react";
|
|
5
|
+
import { Modal, TouchableOpacity, FlatList } from "react-native";
|
|
6
|
+
|
|
7
|
+
// components
|
|
8
|
+
|
|
9
|
+
import Box from "../../box";
|
|
10
|
+
|
|
11
|
+
// commons / icons
|
|
12
|
+
import { Icons } from "../../../common/icons-svg";
|
|
13
|
+
import { getIconModalActivities } from "../../../common/icons-svg/modal-activities";
|
|
14
|
+
|
|
15
|
+
// styles
|
|
16
|
+
import { theme } from "../../../styles/theme/theme";
|
|
17
|
+
import { Typography } from "../../typography";
|
|
18
|
+
import { Button } from "../../button";
|
|
19
|
+
|
|
20
|
+
//typing
|
|
21
|
+
import { IModalActivities, IActivity } from "./interface";
|
|
22
|
+
|
|
23
|
+
// atividades
|
|
24
|
+
import { getActivitiesByType } from "./helpers";
|
|
25
|
+
|
|
26
|
+
export const ModalActivities: React.FC<IModalActivities> = ({
|
|
27
|
+
onClose,
|
|
28
|
+
handleActivity,
|
|
29
|
+
activityType,
|
|
30
|
+
driverType = "carregador",
|
|
31
|
+
isLoading,
|
|
32
|
+
style,
|
|
33
|
+
}) => {
|
|
34
|
+
return (
|
|
35
|
+
<Modal animationType="fade" transparent={true} onRequestClose={onClose}>
|
|
36
|
+
<Box
|
|
37
|
+
backgroundColor={"rgba(0, 0, 0, 0.7)"}
|
|
38
|
+
flexStyle={{ flex: 1, justifyContent: "center", alignItems: "center" }}
|
|
39
|
+
>
|
|
40
|
+
<Box
|
|
41
|
+
height={310}
|
|
42
|
+
width={"92%"}
|
|
43
|
+
backgroundColor={theme.colors.neutral[25]}
|
|
44
|
+
borderStyled={{
|
|
45
|
+
borderColor: theme.colors.blue[500],
|
|
46
|
+
borderWidth: theme.borderWidths.thick,
|
|
47
|
+
borderRadius: theme.borderWidths.thick_medium,
|
|
48
|
+
}}
|
|
49
|
+
paddingStyle={{
|
|
50
|
+
padding: theme.paddings.md,
|
|
51
|
+
}}
|
|
52
|
+
style={{ position: "relative" }}
|
|
53
|
+
>
|
|
54
|
+
<Box
|
|
55
|
+
width={"100%"}
|
|
56
|
+
flexStyle={{
|
|
57
|
+
flexDirection: "row",
|
|
58
|
+
justifyContent: "space-between",
|
|
59
|
+
alignItems: "center",
|
|
60
|
+
}}
|
|
61
|
+
>
|
|
62
|
+
<Typography
|
|
63
|
+
text="Atividades"
|
|
64
|
+
size={theme.fontSizes.md}
|
|
65
|
+
color={theme.colors.blue[500]}
|
|
66
|
+
fontFamily={theme.fonts.inter_bold_700}
|
|
67
|
+
lineHeight={theme.fontSizes.xl}
|
|
68
|
+
/>
|
|
69
|
+
|
|
70
|
+
<TouchableOpacity activeOpacity={0.7} onPress={onClose} style={{}}>
|
|
71
|
+
<Icons icon="CLOSED" color={theme.colors.blue[500]} />
|
|
72
|
+
</TouchableOpacity>
|
|
73
|
+
</Box>
|
|
74
|
+
{/* as atividades */}
|
|
75
|
+
<Box marginStyle={{ marginTop: theme.margins["2xl"] }}>
|
|
76
|
+
<FlatList
|
|
77
|
+
data={getActivitiesByType(driverType, activityType)}
|
|
78
|
+
numColumns={3}
|
|
79
|
+
keyExtractor={(item) => item.id.toString()}
|
|
80
|
+
scrollEnabled={false}
|
|
81
|
+
renderItem={({ item }) => (
|
|
82
|
+
<TouchableOpacity
|
|
83
|
+
style={{
|
|
84
|
+
alignItems: "center",
|
|
85
|
+
width: 110,
|
|
86
|
+
marginBottom: theme.margins["2xl"], // espaço entre as linhas
|
|
87
|
+
}}
|
|
88
|
+
onPress={() => handleActivity(item as IActivity)}
|
|
89
|
+
>
|
|
90
|
+
{getIconModalActivities(item.referencia)}
|
|
91
|
+
|
|
92
|
+
<Typography
|
|
93
|
+
text={item.descricao}
|
|
94
|
+
size={theme.fontSizes.xs}
|
|
95
|
+
color={theme.colors.blue[500]}
|
|
96
|
+
lineHeight={theme.fontSizes.md}
|
|
97
|
+
fontFamily={theme.fonts.inter_medium_500}
|
|
98
|
+
fontWeight="500"
|
|
99
|
+
align="center"
|
|
100
|
+
marginTop={5}
|
|
101
|
+
/>
|
|
102
|
+
</TouchableOpacity>
|
|
103
|
+
)}
|
|
104
|
+
/>
|
|
105
|
+
</Box>
|
|
106
|
+
|
|
107
|
+
<Button
|
|
108
|
+
title={"CANCELAR ATIVIDADE"}
|
|
109
|
+
width="100%"
|
|
110
|
+
height={40}
|
|
111
|
+
activeOpacity={0.7}
|
|
112
|
+
onPress={onClose}
|
|
113
|
+
backgroundColor={theme.colors.blue[500]}
|
|
114
|
+
buttonTextStyle={{
|
|
115
|
+
color: theme.colors.neutral[25],
|
|
116
|
+
fontFamily: theme.fonts.inter_medium_500,
|
|
117
|
+
fontSize: theme.fontSizes.md,
|
|
118
|
+
fontWeight: "500",
|
|
119
|
+
}}
|
|
120
|
+
flexStyle={{
|
|
121
|
+
flexDirection: "row",
|
|
122
|
+
alignItems: "center",
|
|
123
|
+
justifyContent: "center",
|
|
124
|
+
}}
|
|
125
|
+
borderStyled={{
|
|
126
|
+
borderWidth: theme.borderWidths.thin,
|
|
127
|
+
borderColor: theme.colors.blue[500],
|
|
128
|
+
borderRadius: theme.borderWidths.thick_medium,
|
|
129
|
+
}}
|
|
130
|
+
marginStyle={{ marginLeft: theme.margins.md }}
|
|
131
|
+
isLoading={isLoading ?? false}
|
|
132
|
+
style={[style, { position: "absolute", bottom: 10, left: 0 }]}
|
|
133
|
+
/>
|
|
134
|
+
</Box>
|
|
135
|
+
</Box>
|
|
136
|
+
</Modal>
|
|
137
|
+
);
|
|
138
|
+
};
|
|
@@ -1,32 +1,34 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* IMPORTS
|
|
3
|
-
*/
|
|
4
|
-
import { ModalProps } from "react-native";
|
|
5
|
-
|
|
6
|
-
// typing
|
|
7
|
-
import { IGlobalCss } from "../../../styles/global/interface";
|
|
8
|
-
|
|
9
|
-
interface IActivity {
|
|
10
|
-
id: number;
|
|
11
|
-
referencia: string;
|
|
12
|
-
cor_hex: string;
|
|
13
|
-
descricao: string;
|
|
14
|
-
tipo: "trabalho" | "descanso";
|
|
15
|
-
}
|
|
16
|
-
|
|
17
|
-
interface IModalActivities extends ModalProps, IGlobalCss {
|
|
18
|
-
/** função que fecha modal */
|
|
19
|
-
onClose: () => void;
|
|
20
|
-
|
|
21
|
-
/** tipo de atividades */
|
|
22
|
-
activityType: IActivity["tipo"];
|
|
23
|
-
|
|
24
|
-
/** função que manda atividade selecionada */
|
|
25
|
-
// eslint-disable-next-line no-unused-vars
|
|
26
|
-
handleActivity: (activity: IActivity) => void;
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
1
|
+
/**
|
|
2
|
+
* IMPORTS
|
|
3
|
+
*/
|
|
4
|
+
import { ModalProps } from "react-native";
|
|
5
|
+
|
|
6
|
+
// typing
|
|
7
|
+
import { IGlobalCss } from "../../../styles/global/interface";
|
|
8
|
+
|
|
9
|
+
interface IActivity {
|
|
10
|
+
id: number;
|
|
11
|
+
referencia: string;
|
|
12
|
+
cor_hex: string;
|
|
13
|
+
descricao: string;
|
|
14
|
+
tipo: "trabalho" | "descanso";
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
interface IModalActivities extends ModalProps, IGlobalCss {
|
|
18
|
+
/** função que fecha modal */
|
|
19
|
+
onClose: () => void;
|
|
20
|
+
|
|
21
|
+
/** tipo de atividades */
|
|
22
|
+
activityType: IActivity["tipo"];
|
|
23
|
+
|
|
24
|
+
/** função que manda atividade selecionada */
|
|
25
|
+
// eslint-disable-next-line no-unused-vars
|
|
26
|
+
handleActivity: (activity: IActivity) => void;
|
|
27
|
+
|
|
28
|
+
driverType?: "normal" | "carregador";
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
/**
|
|
32
|
+
* EXPORTS
|
|
33
|
+
*/
|
|
34
|
+
export { IModalActivities, IActivity };
|