react-native-exp-fig 0.1.29 → 0.1.30

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.
Files changed (21) hide show
  1. package/lib/commonjs/components/modals/modal-activities/data-activities/index.js +34 -13
  2. package/lib/commonjs/components/modals/modal-activities/data-activities/index.js.map +1 -1
  3. package/lib/commonjs/components/modals/modal-activities/helpers/index.js +30 -0
  4. package/lib/commonjs/components/modals/modal-activities/helpers/index.js.map +1 -0
  5. package/lib/commonjs/components/modals/modal-activities/index.js +5 -4
  6. package/lib/commonjs/components/modals/modal-activities/index.js.map +1 -1
  7. package/lib/commonjs/components/modals/modal-activities/interface.d.js.map +1 -1
  8. package/lib/module/components/modals/modal-activities/data-activities/index.js +33 -12
  9. package/lib/module/components/modals/modal-activities/data-activities/index.js.map +1 -1
  10. package/lib/module/components/modals/modal-activities/helpers/index.js +24 -0
  11. package/lib/module/components/modals/modal-activities/helpers/index.js.map +1 -0
  12. package/lib/module/components/modals/modal-activities/index.js +5 -4
  13. package/lib/module/components/modals/modal-activities/index.js.map +1 -1
  14. package/lib/module/components/modals/modal-activities/interface.d.js.map +1 -1
  15. package/lib/typescript/src/components/modals/modal-activities/data-activities/index.d.ts +12 -17
  16. package/lib/typescript/src/components/modals/modal-activities/helpers/index.d.ts +11 -0
  17. package/package.json +1 -1
  18. package/src/components/modals/modal-activities/data-activities/index.ts +95 -65
  19. package/src/components/modals/modal-activities/helpers/index.ts +25 -0
  20. package/src/components/modals/modal-activities/index.tsx +138 -137
  21. package/src/components/modals/modal-activities/interface.d.ts +34 -32
@@ -3,60 +3,81 @@
3
3
  Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
- exports.activities = void 0;
7
- /**
8
- * dados para os tipos de atividades selecionado
6
+ exports.activitiesByDriverType = void 0;
7
+ /**
8
+ * Tipagem da atividade
9
9
  */
10
- const activities = exports.activities = {
10
+
11
+ /**
12
+ * Lista base de atividades padrão (normal)
13
+ */
14
+ const baseActivities = {
11
15
  trabalho: [{
12
16
  id: 1,
13
17
  referencia: "operacao_veiculo",
14
- cor_hex: "000000",
18
+ cor_hex: "#000000",
15
19
  descricao: "Operação com Veículo",
16
20
  tipo: "trabalho"
17
21
  }, {
18
22
  id: 2,
19
23
  referencia: "aguardando_carga",
20
- cor_hex: "000000",
21
- descricao: "Em carga",
24
+ cor_hex: "#000000",
25
+ descricao: "Em Carga",
22
26
  tipo: "trabalho"
23
27
  }, {
24
28
  id: 3,
25
29
  referencia: "aguardando_descarga",
26
- cor_hex: "000000",
30
+ cor_hex: "#000000",
27
31
  descricao: "Em Descarga",
28
32
  tipo: "trabalho"
29
33
  }, {
30
34
  id: 8,
31
35
  referencia: "disposicao_veiculo_parado",
32
- cor_hex: "000000",
36
+ cor_hex: "#000000",
33
37
  descricao: "Disposição com Veículo Parado",
34
38
  tipo: "trabalho"
35
39
  }],
36
40
  descanso: [{
37
41
  id: 5,
38
42
  referencia: "repouso_semanal",
39
- cor_hex: "000000",
43
+ cor_hex: "#000000",
40
44
  descricao: "Repouso Semanal",
41
45
  tipo: "descanso"
42
46
  }, {
43
47
  id: 6,
44
48
  referencia: "repouso_noturno",
45
- cor_hex: "000000",
49
+ cor_hex: "#000000",
46
50
  descricao: "Repouso Noturno",
47
51
  tipo: "descanso"
48
52
  }, {
49
53
  id: 7,
50
54
  referencia: "refeicao",
51
- cor_hex: "000000",
55
+ cor_hex: "#000000",
52
56
  descricao: "Refeição",
53
57
  tipo: "descanso"
54
58
  }, {
55
59
  id: 9,
56
60
  referencia: "descanso",
57
- cor_hex: "000000",
61
+ cor_hex: "#000000",
58
62
  descricao: "Descanso",
59
63
  tipo: "descanso"
60
64
  }]
61
65
  };
66
+
67
+ /**
68
+ * Atividades específicas por tipo de usuário
69
+ */
70
+ const activitiesByDriverType = exports.activitiesByDriverType = {
71
+ normal: baseActivities,
72
+ carregador: {
73
+ trabalho: [{
74
+ id: 1,
75
+ referencia: "operacao_veiculo",
76
+ cor_hex: "#000000",
77
+ descricao: "Operação com Veículo",
78
+ tipo: "trabalho"
79
+ }],
80
+ descanso: baseActivities.descanso
81
+ }
82
+ };
62
83
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["activities","exports","trabalho","id","referencia","cor_hex","descricao","tipo","descanso"],"sources":["index.ts"],"sourcesContent":["/**\r\n * dados para os tipos de atividades selecionado\r\n */\r\nexport const activities = {\r\n trabalho: [\r\n {\r\n id: 1,\r\n referencia: \"operacao_veiculo\",\r\n cor_hex: \"000000\",\r\n descricao: \"Operação com Veículo\",\r\n tipo: \"trabalho\",\r\n },\r\n {\r\n id: 2,\r\n referencia: \"aguardando_carga\",\r\n cor_hex: \"000000\",\r\n descricao: \"Em carga\",\r\n tipo: \"trabalho\",\r\n },\r\n {\r\n id: 3,\r\n referencia: \"aguardando_descarga\",\r\n cor_hex: \"000000\",\r\n descricao: \"Em Descarga\",\r\n tipo: \"trabalho\",\r\n },\r\n {\r\n id: 8,\r\n referencia: \"disposicao_veiculo_parado\",\r\n cor_hex: \"000000\",\r\n descricao: \"Disposição com Veículo Parado\",\r\n tipo: \"trabalho\",\r\n },\r\n ],\r\n descanso: [\r\n {\r\n id: 5,\r\n referencia: \"repouso_semanal\",\r\n cor_hex: \"000000\",\r\n descricao: \"Repouso Semanal\",\r\n tipo: \"descanso\",\r\n },\r\n {\r\n id: 6,\r\n referencia: \"repouso_noturno\",\r\n cor_hex: \"000000\",\r\n descricao: \"Repouso Noturno\",\r\n tipo: \"descanso\",\r\n },\r\n {\r\n id: 7,\r\n referencia: \"refeicao\",\r\n cor_hex: \"000000\",\r\n descricao: \"Refeição\",\r\n tipo: \"descanso\",\r\n },\r\n {\r\n id: 9,\r\n referencia: \"descanso\",\r\n cor_hex: \"000000\",\r\n descricao: \"Descanso\",\r\n tipo: \"descanso\",\r\n },\r\n ],\r\n};\r\n"],"mappings":";;;;;;AAAA;AACA;AACA;AACO,MAAMA,UAAU,GAAAC,OAAA,CAAA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","referencia","cor_hex","descricao","tipo","descanso","activitiesByDriverType","exports","normal","carregador"],"sources":["index.ts"],"sourcesContent":["/**\n * Tipagem da atividade\n */\nexport interface IActivity {\n id: number;\n referencia: string;\n cor_hex: string;\n descricao: string;\n tipo: \"trabalho\" | \"descanso\";\n}\n\n/**\n * Lista base de atividades padrão (normal)\n */\nconst baseActivities: Record<string, IActivity[]> = {\n trabalho: [\n {\n id: 1,\n referencia: \"operacao_veiculo\",\n cor_hex: \"#000000\",\n descricao: \"Operação com Veículo\",\n tipo: \"trabalho\",\n },\n {\n id: 2,\n referencia: \"aguardando_carga\",\n cor_hex: \"#000000\",\n descricao: \"Em Carga\",\n tipo: \"trabalho\",\n },\n {\n id: 3,\n referencia: \"aguardando_descarga\",\n cor_hex: \"#000000\",\n descricao: \"Em Descarga\",\n tipo: \"trabalho\",\n },\n {\n id: 8,\n referencia: \"disposicao_veiculo_parado\",\n cor_hex: \"#000000\",\n descricao: \"Disposição com Veículo Parado\",\n tipo: \"trabalho\",\n },\n ],\n descanso: [\n {\n id: 5,\n referencia: \"repouso_semanal\",\n cor_hex: \"#000000\",\n descricao: \"Repouso Semanal\",\n tipo: \"descanso\",\n },\n {\n id: 6,\n referencia: \"repouso_noturno\",\n cor_hex: \"#000000\",\n descricao: \"Repouso Noturno\",\n tipo: \"descanso\",\n },\n {\n id: 7,\n referencia: \"refeicao\",\n cor_hex: \"#000000\",\n descricao: \"Refeição\",\n tipo: \"descanso\",\n },\n {\n id: 9,\n referencia: \"descanso\",\n cor_hex: \"#000000\",\n descricao: \"Descanso\",\n tipo: \"descanso\",\n },\n ],\n};\n\n/**\n * Atividades específicas por tipo de usuário\n */\nexport const activitiesByDriverType: Record<string, Record<string, IActivity[]>> = {\n normal: baseActivities,\n carregador: {\n trabalho: [\n {\n id: 1,\n referencia: \"operacao_veiculo\",\n cor_hex: \"#000000\",\n descricao: \"Operação com Veículo\",\n tipo: \"trabalho\",\n },\n ],\n descanso: baseActivities.descanso!,\n },\n};\n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AAC;;AAED;AACA;AACA;AACO,MAAME,sBAAmE,GAAAC,OAAA,CAAAD,sBAAA,GAAG;EACjFE,MAAM,EAAEV,cAAc;EACtBW,UAAU,EAAE;IACVV,QAAQ,EAAE,CACR;MACEC,EAAE,EAAE,CAAC;MACLC,UAAU,EAAE,kBAAkB;MAC9BC,OAAO,EAAE,SAAS;MAClBC,SAAS,EAAE,sBAAsB;MACjCC,IAAI,EAAE;IACR,CAAC,CACF;IACDC,QAAQ,EAAEP,cAAc,CAACO;EAC3B;AACF,CAAC","ignoreList":[]}
@@ -0,0 +1,30 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.getActivitiesByType = void 0;
7
+ var _dataActivities = require("../data-activities");
8
+ /**
9
+ * IMPORTS
10
+ */
11
+
12
+ /**
13
+ * Função que retorna as atividades por tipo de atividade e tipo de usuário (normal ou carregador)
14
+ * @param driverType
15
+ * @param activityType
16
+ * @returns
17
+ */
18
+ const getActivitiesByType = (driverType, activityType) => {
19
+ const driverActivities = _dataActivities.activitiesByDriverType[driverType];
20
+ if (!driverActivities) {
21
+ return _dataActivities.activitiesByDriverType["carregador"][activityType] || [];
22
+ }
23
+ return driverActivities[activityType] || [];
24
+ };
25
+
26
+ /**
27
+ * EXPORTS
28
+ */
29
+ exports.getActivitiesByType = getActivitiesByType;
30
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["_dataActivities","require","getActivitiesByType","driverType","activityType","driverActivities","activitiesByDriverType","exports"],"sources":["index.ts"],"sourcesContent":["/**\n * IMPORTS\n */\nimport { activitiesByDriverType } from \"../data-activities\";\n\n/**\n * Função que retorna as atividades por tipo de atividade e tipo de usuário (normal ou carregador)\n * @param driverType\n * @param activityType\n * @returns\n */\nconst getActivitiesByType = (driverType: string, activityType: string) => {\n const driverActivities = activitiesByDriverType[driverType];\n\n if (!driverActivities) {\n return activitiesByDriverType[\"carregador\"]![activityType] || [];\n }\n\n return driverActivities[activityType] || [];\n};\n\n/**\n * EXPORTS\n */\nexport { getActivitiesByType };\n"],"mappings":";;;;;;AAGA,IAAAA,eAAA,GAAAC,OAAA;AAHA;AACA;AACA;;AAGA;AACA;AACA;AACA;AACA;AACA;AACA,MAAMC,mBAAmB,GAAGA,CAACC,UAAkB,EAAEC,YAAoB,KAAK;EACxE,MAAMC,gBAAgB,GAAGC,sCAAsB,CAACH,UAAU,CAAC;EAE3D,IAAI,CAACE,gBAAgB,EAAE;IACrB,OAAOC,sCAAsB,CAAC,YAAY,CAAC,CAAEF,YAAY,CAAC,IAAI,EAAE;EAClE;EAEA,OAAOC,gBAAgB,CAACD,YAAY,CAAC,IAAI,EAAE;AAC7C,CAAC;;AAED;AACA;AACA;AAFAG,OAAA,CAAAL,mBAAA,GAAAA,mBAAA","ignoreList":[]}
@@ -12,10 +12,10 @@ var _modalActivities = require("../../../common/icons-svg/modal-activities");
12
12
  var _theme = require("../../../styles/theme/theme");
13
13
  var _typography = require("../../typography");
14
14
  var _button = require("../../button");
15
- var _dataActivities = require("./data-activities");
15
+ var _helpers = require("./helpers");
16
16
  function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
17
- /**
18
- * IMPORTS
17
+ /**
18
+ * IMPORTS
19
19
  */
20
20
 
21
21
  // components
@@ -32,6 +32,7 @@ const ModalActivities = ({
32
32
  onClose,
33
33
  handleActivity,
34
34
  activityType,
35
+ driverType = "carregador",
35
36
  isLoading,
36
37
  style
37
38
  }) => {
@@ -86,7 +87,7 @@ const ModalActivities = ({
86
87
  marginTop: _theme.theme.margins["2xl"]
87
88
  }
88
89
  }, /*#__PURE__*/_react.default.createElement(_reactNative.FlatList, {
89
- data: _dataActivities.activities[activityType],
90
+ data: (0, _helpers.getActivitiesByType)(driverType, activityType),
90
91
  numColumns: 3,
91
92
  keyExtractor: item => item.id.toString(),
92
93
  scrollEnabled: false,
@@ -1 +1 @@
1
- {"version":3,"names":["_react","_interopRequireDefault","require","_reactNative","_box","_iconsSvg","_modalActivities","_theme","_typography","_button","_dataActivities","e","__esModule","default","ModalActivities","onClose","handleActivity","activityType","isLoading","style","createElement","Modal","animationType","transparent","onRequestClose","backgroundColor","flexStyle","flex","justifyContent","alignItems","height","width","theme","colors","neutral","borderStyled","borderColor","blue","borderWidth","borderWidths","thick","borderRadius","thick_medium","paddingStyle","padding","paddings","md","position","flexDirection","Typography","text","size","fontSizes","color","fontFamily","fonts","inter_bold_700","lineHeight","xl","TouchableOpacity","activeOpacity","onPress","Icons","icon","marginStyle","marginTop","margins","FlatList","data","activities","numColumns","keyExtractor","item","id","toString","scrollEnabled","renderItem","marginBottom","getIconModalActivities","referencia","descricao","xs","inter_medium_500","fontWeight","align","Button","title","buttonTextStyle","fontSize","thin","marginLeft","bottom","left","exports"],"sources":["index.tsx"],"sourcesContent":["/**\r\n * IMPORTS\r\n */\r\nimport React from \"react\";\r\nimport { Modal, TouchableOpacity, FlatList } from \"react-native\";\r\n\r\n// components\r\n\r\nimport Box from \"../../box\";\r\n\r\n// commons / icons\r\nimport { Icons } from \"../../../common/icons-svg\";\r\nimport { getIconModalActivities } from \"../../../common/icons-svg/modal-activities\";\r\n\r\n// styles\r\nimport { theme } from \"../../../styles/theme/theme\";\r\nimport { Typography } from \"../../typography\";\r\nimport { Button } from \"../../button\";\r\n\r\n//typing\r\nimport { IModalActivities, IActivity } from \"./interface\";\r\n\r\n// atividades\r\nimport { activities } from \"./data-activities\";\r\n\r\nexport const ModalActivities: React.FC<IModalActivities> = ({\r\n onClose,\r\n handleActivity,\r\n activityType,\r\n isLoading,\r\n style,\r\n}) => {\r\n return (\r\n <Modal animationType=\"fade\" transparent={true} onRequestClose={onClose}>\r\n <Box\r\n backgroundColor={\"rgba(0, 0, 0, 0.7)\"}\r\n flexStyle={{ flex: 1, justifyContent: \"center\", alignItems: \"center\" }}\r\n >\r\n <Box\r\n height={310}\r\n width={\"92%\"}\r\n backgroundColor={theme.colors.neutral[25]}\r\n borderStyled={{\r\n borderColor: theme.colors.blue[500],\r\n borderWidth: theme.borderWidths.thick,\r\n borderRadius: theme.borderWidths.thick_medium,\r\n }}\r\n paddingStyle={{\r\n padding: theme.paddings.md,\r\n }}\r\n style={{ position: \"relative\" }}\r\n >\r\n <Box\r\n width={\"100%\"}\r\n flexStyle={{\r\n flexDirection: \"row\",\r\n justifyContent: \"space-between\",\r\n alignItems: \"center\",\r\n }}\r\n >\r\n <Typography\r\n text=\"Atividades\"\r\n size={theme.fontSizes.md}\r\n color={theme.colors.blue[500]}\r\n fontFamily={theme.fonts.inter_bold_700}\r\n lineHeight={theme.fontSizes.xl}\r\n />\r\n\r\n <TouchableOpacity activeOpacity={0.7} onPress={onClose} style={{}}>\r\n <Icons icon=\"CLOSED\" color={theme.colors.blue[500]} />\r\n </TouchableOpacity>\r\n </Box>\r\n {/* as atividades */}\r\n <Box marginStyle={{ marginTop: theme.margins[\"2xl\"] }}>\r\n <FlatList\r\n data={activities[activityType]}\r\n numColumns={3}\r\n keyExtractor={(item) => item.id.toString()}\r\n scrollEnabled={false}\r\n renderItem={({ item }) => (\r\n <TouchableOpacity\r\n style={{\r\n alignItems: \"center\",\r\n width: 110,\r\n marginBottom: theme.margins[\"2xl\"], // espaço entre as linhas\r\n }}\r\n onPress={() => handleActivity(item as IActivity)}\r\n >\r\n {getIconModalActivities(item.referencia)}\r\n\r\n <Typography\r\n text={item.descricao}\r\n size={theme.fontSizes.xs}\r\n color={theme.colors.blue[500]}\r\n lineHeight={theme.fontSizes.md}\r\n fontFamily={theme.fonts.inter_medium_500}\r\n fontWeight=\"500\"\r\n align=\"center\"\r\n marginTop={5}\r\n />\r\n </TouchableOpacity>\r\n )}\r\n />\r\n </Box>\r\n\r\n <Button\r\n title={\"CANCELAR ATIVIDADE\"}\r\n width=\"100%\"\r\n height={40}\r\n activeOpacity={0.7}\r\n onPress={onClose}\r\n backgroundColor={theme.colors.blue[500]}\r\n buttonTextStyle={{\r\n color: theme.colors.neutral[25],\r\n fontFamily: theme.fonts.inter_medium_500,\r\n fontSize: theme.fontSizes.md,\r\n fontWeight: \"500\",\r\n }}\r\n flexStyle={{\r\n flexDirection: \"row\",\r\n alignItems: \"center\",\r\n justifyContent: \"center\",\r\n }}\r\n borderStyled={{\r\n borderWidth: theme.borderWidths.thin,\r\n borderColor: theme.colors.blue[500],\r\n borderRadius: theme.borderWidths.thick_medium,\r\n }}\r\n marginStyle={{ marginLeft: theme.margins.md }}\r\n isLoading={isLoading ?? false}\r\n style={[style, { position: \"absolute\", bottom: 10, left: 0 }]}\r\n />\r\n </Box>\r\n </Box>\r\n </Modal>\r\n );\r\n};\r\n"],"mappings":";;;;;;AAGA,IAAAA,MAAA,GAAAC,sBAAA,CAAAC,OAAA;AACA,IAAAC,YAAA,GAAAD,OAAA;AAIA,IAAAE,IAAA,GAAAH,sBAAA,CAAAC,OAAA;AAGA,IAAAG,SAAA,GAAAH,OAAA;AACA,IAAAI,gBAAA,GAAAJ,OAAA;AAGA,IAAAK,MAAA,GAAAL,OAAA;AACA,IAAAM,WAAA,GAAAN,OAAA;AACA,IAAAO,OAAA,GAAAP,OAAA;AAMA,IAAAQ,eAAA,GAAAR,OAAA;AAA+C,SAAAD,uBAAAU,CAAA,WAAAA,CAAA,IAAAA,CAAA,CAAAC,UAAA,GAAAD,CAAA,KAAAE,OAAA,EAAAF,CAAA;AAvB/C;AACA;AACA;;AAIA;;AAIA;;AAIA;;AAKA;;AAGA;;AAGO,MAAMG,eAA2C,GAAGA,CAAC;EAC1DC,OAAO;EACPC,cAAc;EACdC,YAAY;EACZC,SAAS;EACTC;AACF,CAAC,KAAK;EACJ,oBACEnB,MAAA,CAAAa,OAAA,CAAAO,aAAA,CAACjB,YAAA,CAAAkB,KAAK;IAACC,aAAa,EAAC,MAAM;IAACC,WAAW,EAAE,IAAK;IAACC,cAAc,EAAET;EAAQ,gBACrEf,MAAA,CAAAa,OAAA,CAAAO,aAAA,CAAChB,IAAA,CAAAS,OAAG;IACFY,eAAe,EAAE,oBAA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,EAAE;MAAE4B,QAAQ,EAAE,UAAU;MAAE4C,MAAM,EAAE,EAAE;MAAEC,IAAI,EAAE;IAAE,CAAC;EAAE,CAC/D,CACE,CACF,CACA,CAAC;AAEZ,CAAC;AAACC,OAAA,CAAA/E,eAAA,GAAAA,eAAA","ignoreList":[]}
1
+ {"version":3,"names":["_react","_interopRequireDefault","require","_reactNative","_box","_iconsSvg","_modalActivities","_theme","_typography","_button","_helpers","e","__esModule","default","ModalActivities","onClose","handleActivity","activityType","driverType","isLoading","style","createElement","Modal","animationType","transparent","onRequestClose","backgroundColor","flexStyle","flex","justifyContent","alignItems","height","width","theme","colors","neutral","borderStyled","borderColor","blue","borderWidth","borderWidths","thick","borderRadius","thick_medium","paddingStyle","padding","paddings","md","position","flexDirection","Typography","text","size","fontSizes","color","fontFamily","fonts","inter_bold_700","lineHeight","xl","TouchableOpacity","activeOpacity","onPress","Icons","icon","marginStyle","marginTop","margins","FlatList","data","getActivitiesByType","numColumns","keyExtractor","item","id","toString","scrollEnabled","renderItem","marginBottom","getIconModalActivities","referencia","descricao","xs","inter_medium_500","fontWeight","align","Button","title","buttonTextStyle","fontSize","thin","marginLeft","bottom","left","exports"],"sources":["index.tsx"],"sourcesContent":["/**\n * IMPORTS\n */\nimport React from \"react\";\nimport { Modal, TouchableOpacity, FlatList } from \"react-native\";\n\n// components\n\nimport Box from \"../../box\";\n\n// commons / icons\nimport { Icons } from \"../../../common/icons-svg\";\nimport { getIconModalActivities } from \"../../../common/icons-svg/modal-activities\";\n\n// styles\nimport { theme } from \"../../../styles/theme/theme\";\nimport { Typography } from \"../../typography\";\nimport { Button } from \"../../button\";\n\n//typing\nimport { IModalActivities, IActivity } from \"./interface\";\n\n// atividades\nimport { getActivitiesByType } from \"./helpers\";\n\nexport const ModalActivities: React.FC<IModalActivities> = ({\n onClose,\n handleActivity,\n activityType,\n driverType = \"carregador\",\n isLoading,\n style,\n}) => {\n return (\n <Modal animationType=\"fade\" transparent={true} onRequestClose={onClose}>\n <Box\n backgroundColor={\"rgba(0, 0, 0, 0.7)\"}\n flexStyle={{ flex: 1, justifyContent: \"center\", alignItems: \"center\" }}\n >\n <Box\n height={310}\n width={\"92%\"}\n backgroundColor={theme.colors.neutral[25]}\n borderStyled={{\n borderColor: theme.colors.blue[500],\n borderWidth: theme.borderWidths.thick,\n borderRadius: theme.borderWidths.thick_medium,\n }}\n paddingStyle={{\n padding: theme.paddings.md,\n }}\n style={{ position: \"relative\" }}\n >\n <Box\n width={\"100%\"}\n flexStyle={{\n flexDirection: \"row\",\n justifyContent: \"space-between\",\n alignItems: \"center\",\n }}\n >\n <Typography\n text=\"Atividades\"\n size={theme.fontSizes.md}\n color={theme.colors.blue[500]}\n fontFamily={theme.fonts.inter_bold_700}\n lineHeight={theme.fontSizes.xl}\n />\n\n <TouchableOpacity activeOpacity={0.7} onPress={onClose} style={{}}>\n <Icons icon=\"CLOSED\" color={theme.colors.blue[500]} />\n </TouchableOpacity>\n </Box>\n {/* as atividades */}\n <Box marginStyle={{ marginTop: theme.margins[\"2xl\"] }}>\n <FlatList\n data={getActivitiesByType(driverType, activityType)}\n numColumns={3}\n keyExtractor={(item) => item.id.toString()}\n scrollEnabled={false}\n renderItem={({ item }) => (\n <TouchableOpacity\n style={{\n alignItems: \"center\",\n width: 110,\n marginBottom: theme.margins[\"2xl\"], // espaço entre as linhas\n }}\n onPress={() => handleActivity(item as IActivity)}\n >\n {getIconModalActivities(item.referencia)}\n\n <Typography\n text={item.descricao}\n size={theme.fontSizes.xs}\n color={theme.colors.blue[500]}\n lineHeight={theme.fontSizes.md}\n fontFamily={theme.fonts.inter_medium_500}\n fontWeight=\"500\"\n align=\"center\"\n marginTop={5}\n />\n </TouchableOpacity>\n )}\n />\n </Box>\n\n <Button\n title={\"CANCELAR ATIVIDADE\"}\n width=\"100%\"\n height={40}\n activeOpacity={0.7}\n onPress={onClose}\n backgroundColor={theme.colors.blue[500]}\n buttonTextStyle={{\n color: theme.colors.neutral[25],\n fontFamily: theme.fonts.inter_medium_500,\n fontSize: theme.fontSizes.md,\n fontWeight: \"500\",\n }}\n flexStyle={{\n flexDirection: \"row\",\n alignItems: \"center\",\n justifyContent: \"center\",\n }}\n borderStyled={{\n borderWidth: theme.borderWidths.thin,\n borderColor: theme.colors.blue[500],\n borderRadius: theme.borderWidths.thick_medium,\n }}\n marginStyle={{ marginLeft: theme.margins.md }}\n isLoading={isLoading ?? false}\n style={[style, { position: \"absolute\", bottom: 10, left: 0 }]}\n />\n </Box>\n </Box>\n </Modal>\n );\n};\n"],"mappings":";;;;;;AAGA,IAAAA,MAAA,GAAAC,sBAAA,CAAAC,OAAA;AACA,IAAAC,YAAA,GAAAD,OAAA;AAIA,IAAAE,IAAA,GAAAH,sBAAA,CAAAC,OAAA;AAGA,IAAAG,SAAA,GAAAH,OAAA;AACA,IAAAI,gBAAA,GAAAJ,OAAA;AAGA,IAAAK,MAAA,GAAAL,OAAA;AACA,IAAAM,WAAA,GAAAN,OAAA;AACA,IAAAO,OAAA,GAAAP,OAAA;AAMA,IAAAQ,QAAA,GAAAR,OAAA;AAAgD,SAAAD,uBAAAU,CAAA,WAAAA,CAAA,IAAAA,CAAA,CAAAC,UAAA,GAAAD,CAAA,KAAAE,OAAA,EAAAF,CAAA;AAvBhD;AACA;AACA;;AAIA;;AAIA;;AAIA;;AAKA;;AAGA;;AAGO,MAAMG,eAA2C,GAAGA,CAAC;EAC1DC,OAAO;EACPC,cAAc;EACdC,YAAY;EACZC,UAAU,GAAG,YAAY;EACzBC,SAAS;EACTC;AACF,CAAC,KAAK;EACJ,oBACEpB,MAAA,CAAAa,OAAA,CAAAQ,aAAA,CAAClB,YAAA,CAAAmB,KAAK;IAACC,aAAa,EAAC,MAAM;IAACC,WAAW,EAAE,IAAK;IAACC,cAAc,EAAEV;EAAQ,gBACrEf,MAAA,CAAAa,OAAA,CAAAQ,aAAA,CAACjB,IAAA,CAAAS,OAAG;IACFa,eAAe,EAAE,oBAAqB;IACtCC,SAAS,EAAE;MAAE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,EAAE;MAAE4B,QAAQ,EAAE,UAAU;MAAE4C,MAAM,EAAE,EAAE;MAAEC,IAAI,EAAE;IAAE,CAAC;EAAE,CAC/D,CACE,CACF,CACA,CAAC;AAEZ,CAAC;AAACC,OAAA,CAAAhF,eAAA,GAAAA,eAAA","ignoreList":[]}
@@ -1 +1 @@
1
- {"version":3,"names":[],"sources":["interface.d.ts"],"sourcesContent":["/**\r\n * IMPORTS\r\n */\r\nimport { ModalProps } from \"react-native\";\r\n\r\n// typing\r\nimport { IGlobalCss } from \"../../../styles/global/interface\";\r\n\r\ninterface IActivity {\r\n id: number;\r\n referencia: string;\r\n cor_hex: string;\r\n descricao: string;\r\n tipo: \"trabalho\" | \"descanso\";\r\n}\r\n\r\ninterface IModalActivities extends ModalProps, IGlobalCss {\r\n /** função que fecha modal */\r\n onClose: () => void;\r\n\r\n /** tipo de atividades */\r\n activityType: IActivity[\"tipo\"];\r\n\r\n /** função que manda atividade selecionada */\r\n // eslint-disable-next-line no-unused-vars\r\n handleActivity: (activity: IActivity) => void;\r\n}\r\n\r\n/**\r\n * EXPORTS\r\n */\r\nexport { IModalActivities, IActivity };\r\n"],"mappings":"","ignoreList":[]}
1
+ {"version":3,"names":[],"sources":["interface.d.ts"],"sourcesContent":["/**\n * IMPORTS\n */\nimport { ModalProps } from \"react-native\";\n\n// typing\nimport { IGlobalCss } from \"../../../styles/global/interface\";\n\ninterface IActivity {\n id: number;\n referencia: string;\n cor_hex: string;\n descricao: string;\n tipo: \"trabalho\" | \"descanso\";\n}\n\ninterface IModalActivities extends ModalProps, IGlobalCss {\n /** função que fecha modal */\n onClose: () => void;\n\n /** tipo de atividades */\n activityType: IActivity[\"tipo\"];\n\n /** função que manda atividade selecionada */\n // eslint-disable-next-line no-unused-vars\n handleActivity: (activity: IActivity) => void;\n\n driverType?: \"normal\" | \"carregador\";\n}\n\n/**\n * EXPORTS\n */\nexport { IModalActivities, IActivity };\n"],"mappings":"","ignoreList":[]}
@@ -1,56 +1,77 @@
1
- /**
2
- * dados para os tipos de atividades selecionado
1
+ /**
2
+ * Tipagem da atividade
3
3
  */
4
- export const activities = {
4
+
5
+ /**
6
+ * Lista base de atividades padrão (normal)
7
+ */
8
+ const baseActivities = {
5
9
  trabalho: [{
6
10
  id: 1,
7
11
  referencia: "operacao_veiculo",
8
- cor_hex: "000000",
12
+ cor_hex: "#000000",
9
13
  descricao: "Operação com Veículo",
10
14
  tipo: "trabalho"
11
15
  }, {
12
16
  id: 2,
13
17
  referencia: "aguardando_carga",
14
- cor_hex: "000000",
15
- descricao: "Em carga",
18
+ cor_hex: "#000000",
19
+ descricao: "Em Carga",
16
20
  tipo: "trabalho"
17
21
  }, {
18
22
  id: 3,
19
23
  referencia: "aguardando_descarga",
20
- cor_hex: "000000",
24
+ cor_hex: "#000000",
21
25
  descricao: "Em Descarga",
22
26
  tipo: "trabalho"
23
27
  }, {
24
28
  id: 8,
25
29
  referencia: "disposicao_veiculo_parado",
26
- cor_hex: "000000",
30
+ cor_hex: "#000000",
27
31
  descricao: "Disposição com Veículo Parado",
28
32
  tipo: "trabalho"
29
33
  }],
30
34
  descanso: [{
31
35
  id: 5,
32
36
  referencia: "repouso_semanal",
33
- cor_hex: "000000",
37
+ cor_hex: "#000000",
34
38
  descricao: "Repouso Semanal",
35
39
  tipo: "descanso"
36
40
  }, {
37
41
  id: 6,
38
42
  referencia: "repouso_noturno",
39
- cor_hex: "000000",
43
+ cor_hex: "#000000",
40
44
  descricao: "Repouso Noturno",
41
45
  tipo: "descanso"
42
46
  }, {
43
47
  id: 7,
44
48
  referencia: "refeicao",
45
- cor_hex: "000000",
49
+ cor_hex: "#000000",
46
50
  descricao: "Refeição",
47
51
  tipo: "descanso"
48
52
  }, {
49
53
  id: 9,
50
54
  referencia: "descanso",
51
- cor_hex: "000000",
55
+ cor_hex: "#000000",
52
56
  descricao: "Descanso",
53
57
  tipo: "descanso"
54
58
  }]
55
59
  };
60
+
61
+ /**
62
+ * Atividades específicas por tipo de usuário
63
+ */
64
+ export const activitiesByDriverType = {
65
+ normal: baseActivities,
66
+ carregador: {
67
+ trabalho: [{
68
+ id: 1,
69
+ referencia: "operacao_veiculo",
70
+ cor_hex: "#000000",
71
+ descricao: "Operação com Veículo",
72
+ tipo: "trabalho"
73
+ }],
74
+ descanso: baseActivities.descanso
75
+ }
76
+ };
56
77
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["activities","trabalho","id","referencia","cor_hex","descricao","tipo","descanso"],"sources":["index.ts"],"sourcesContent":["/**\r\n * dados para os tipos de atividades selecionado\r\n */\r\nexport const activities = {\r\n trabalho: [\r\n {\r\n id: 1,\r\n referencia: \"operacao_veiculo\",\r\n cor_hex: \"000000\",\r\n descricao: \"Operação com Veículo\",\r\n tipo: \"trabalho\",\r\n },\r\n {\r\n id: 2,\r\n referencia: \"aguardando_carga\",\r\n cor_hex: \"000000\",\r\n descricao: \"Em carga\",\r\n tipo: \"trabalho\",\r\n },\r\n {\r\n id: 3,\r\n referencia: \"aguardando_descarga\",\r\n cor_hex: \"000000\",\r\n descricao: \"Em Descarga\",\r\n tipo: \"trabalho\",\r\n },\r\n {\r\n id: 8,\r\n referencia: \"disposicao_veiculo_parado\",\r\n cor_hex: \"000000\",\r\n descricao: \"Disposição com Veículo Parado\",\r\n tipo: \"trabalho\",\r\n },\r\n ],\r\n descanso: [\r\n {\r\n id: 5,\r\n referencia: \"repouso_semanal\",\r\n cor_hex: \"000000\",\r\n descricao: \"Repouso Semanal\",\r\n tipo: \"descanso\",\r\n },\r\n {\r\n id: 6,\r\n referencia: \"repouso_noturno\",\r\n cor_hex: \"000000\",\r\n descricao: \"Repouso Noturno\",\r\n tipo: \"descanso\",\r\n },\r\n {\r\n id: 7,\r\n referencia: \"refeicao\",\r\n cor_hex: \"000000\",\r\n descricao: \"Refeição\",\r\n tipo: \"descanso\",\r\n },\r\n {\r\n id: 9,\r\n referencia: \"descanso\",\r\n cor_hex: \"000000\",\r\n descricao: \"Descanso\",\r\n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IAAI,EAAE;EACR,CAAC;AAEL,CAAC","ignoreList":[]}
1
+ {"version":3,"names":["baseActivities","trabalho","id","referencia","cor_hex","descricao","tipo","descanso","activitiesByDriverType","normal","carregador"],"sources":["index.ts"],"sourcesContent":["/**\n * Tipagem da atividade\n */\nexport interface IActivity {\n id: number;\n referencia: string;\n cor_hex: string;\n descricao: string;\n tipo: \"trabalho\" | \"descanso\";\n}\n\n/**\n * Lista base de atividades padrão (normal)\n */\nconst baseActivities: Record<string, IActivity[]> = {\n trabalho: [\n {\n id: 1,\n referencia: \"operacao_veiculo\",\n cor_hex: \"#000000\",\n descricao: \"Operação com Veículo\",\n tipo: \"trabalho\",\n },\n {\n id: 2,\n referencia: \"aguardando_carga\",\n cor_hex: \"#000000\",\n descricao: \"Em Carga\",\n tipo: \"trabalho\",\n },\n {\n id: 3,\n referencia: \"aguardando_descarga\",\n cor_hex: \"#000000\",\n descricao: \"Em Descarga\",\n tipo: \"trabalho\",\n },\n {\n id: 8,\n referencia: \"disposicao_veiculo_parado\",\n cor_hex: \"#000000\",\n descricao: \"Disposição com Veículo Parado\",\n tipo: \"trabalho\",\n },\n ],\n descanso: [\n {\n id: 5,\n referencia: \"repouso_semanal\",\n cor_hex: \"#000000\",\n descricao: \"Repouso Semanal\",\n tipo: \"descanso\",\n },\n {\n id: 6,\n referencia: \"repouso_noturno\",\n cor_hex: \"#000000\",\n descricao: \"Repouso Noturno\",\n tipo: \"descanso\",\n },\n {\n id: 7,\n referencia: \"refeicao\",\n cor_hex: \"#000000\",\n descricao: \"Refeição\",\n tipo: \"descanso\",\n },\n {\n id: 9,\n referencia: \"descanso\",\n cor_hex: \"#000000\",\n descricao: \"Descanso\",\n tipo: \"descanso\",\n },\n ],\n};\n\n/**\n * Atividades específicas por tipo de usuário\n */\nexport const activitiesByDriverType: Record<string, Record<string, IActivity[]>> = {\n normal: baseActivities,\n carregador: {\n trabalho: [\n {\n id: 1,\n referencia: \"operacao_veiculo\",\n cor_hex: \"#000000\",\n descricao: \"Operação com Veículo\",\n tipo: \"trabalho\",\n },\n ],\n descanso: baseActivities.descanso!,\n },\n};\n"],"mappings":"AAAA;AACA;AACA;;AASA;AACA;AACA;AACA,MAAMA,cAA2C,GAAG;EAClDC,QAAQ,EAAE,CACR;IACEC,EAAE,EAAE,CAAC;IACLC,UAAU,EAAE,kBAAkB;IAC9BC,OAAO,EAAE,SAAS;IAClBC,SAAS,EAAE,sBAAsB;IACjCC,IAAI,EAAE;EACR,CAAC,EACD;IACEJ,EAAE,EAAE,CAAC;IACLC,UAAU,EAAE,kBAAkB;IAC9BC,OAAO,EAAE,SAAS;IAClBC,SAAS,EAAE,UAAU;IACrBC,IAAI,EAAE;EACR,CAAC,EACD;IACEJ,EAAE,EAAE,CAAC;IACLC,UAAU,EAAE,qBAAqB;IACjCC,OAAO,EAAE,SAAS;IAClBC,SAAS,EAAE,aAAa;IACxBC,IAAI,EAAE;EACR,CAAC,EACD;IACEJ,EAAE,EAAE,CAAC;IACLC,UAAU,EAAE,2BAA2B;IACvCC,OAAO,EAAE,SAAS;IAClBC,SAAS,EAAE,+BAA+B;IAC1CC,IAAI,EAAE;EACR,CAAC,CACF;EACDC,QAAQ,EAAE,CACR;IACEL,EAAE,EAAE,CAAC;IACLC,UAAU,EAAE,iBAAiB;IAC7BC,OAAO,EAAE,SAAS;IAClBC,SAAS,EAAE,iBAAiB;IAC5BC,IAAI,EAAE;EACR,CAAC,EACD;IACEJ,EAAE,EAAE,CAAC;IACLC,UAAU,EAAE,iBAAiB;IAC7BC,OAAO,EAAE,SAAS;IAClBC,SAAS,EAAE,iBAAiB;IAC5BC,IAAI,EAAE;EACR,CAAC,EACD;IACEJ,EAAE,EAAE,CAAC;IACLC,UAAU,EAAE,UAAU;IACtBC,OAAO,EAAE,SAAS;IAClBC,SAAS,EAAE,UAAU;IACrBC,IAAI,EAAE;EACR,CAAC,EACD;IACEJ,EAAE,EAAE,CAAC;IACLC,UAAU,EAAE,UAAU;IACtBC,OAAO,EAAE,SAAS;IAClBC,SAAS,EAAE,UAAU;IACrBC,IAAI,EAAE;EACR,CAAC;AAEL,CAAC;;AAED;AACA;AACA;AACA,OAAO,MAAME,sBAAmE,GAAG;EACjFC,MAAM,EAAET,cAAc;EACtBU,UAAU,EAAE;IACVT,QAAQ,EAAE,CACR;MACEC,EAAE,EAAE,CAAC;MACLC,UAAU,EAAE,kBAAkB;MAC9BC,OAAO,EAAE,SAAS;MAClBC,SAAS,EAAE,sBAAsB;MACjCC,IAAI,EAAE;IACR,CAAC,CACF;IACDC,QAAQ,EAAEP,cAAc,CAACO;EAC3B;AACF,CAAC","ignoreList":[]}
@@ -0,0 +1,24 @@
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, activityType) => {
13
+ const driverActivities = activitiesByDriverType[driverType];
14
+ if (!driverActivities) {
15
+ return activitiesByDriverType["carregador"][activityType] || [];
16
+ }
17
+ return driverActivities[activityType] || [];
18
+ };
19
+
20
+ /**
21
+ * EXPORTS
22
+ */
23
+ export { getActivitiesByType };
24
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["activitiesByDriverType","getActivitiesByType","driverType","activityType","driverActivities"],"sources":["index.ts"],"sourcesContent":["/**\n * IMPORTS\n */\nimport { activitiesByDriverType } from \"../data-activities\";\n\n/**\n * Função que retorna as atividades por tipo de atividade e tipo de usuário (normal ou carregador)\n * @param driverType\n * @param activityType\n * @returns\n */\nconst getActivitiesByType = (driverType: string, activityType: string) => {\n const driverActivities = activitiesByDriverType[driverType];\n\n if (!driverActivities) {\n return activitiesByDriverType[\"carregador\"]![activityType] || [];\n }\n\n return driverActivities[activityType] || [];\n};\n\n/**\n * EXPORTS\n */\nexport { getActivitiesByType };\n"],"mappings":"AAAA;AACA;AACA;AACA,SAASA,sBAAsB,QAAQ,oBAAoB;;AAE3D;AACA;AACA;AACA;AACA;AACA;AACA,MAAMC,mBAAmB,GAAGA,CAACC,UAAkB,EAAEC,YAAoB,KAAK;EACxE,MAAMC,gBAAgB,GAAGJ,sBAAsB,CAACE,UAAU,CAAC;EAE3D,IAAI,CAACE,gBAAgB,EAAE;IACrB,OAAOJ,sBAAsB,CAAC,YAAY,CAAC,CAAEG,YAAY,CAAC,IAAI,EAAE;EAClE;EAEA,OAAOC,gBAAgB,CAACD,YAAY,CAAC,IAAI,EAAE;AAC7C,CAAC;;AAED;AACA;AACA;AACA,SAASF,mBAAmB","ignoreList":[]}
@@ -1,5 +1,5 @@
1
- /**
2
- * IMPORTS
1
+ /**
2
+ * IMPORTS
3
3
  */
4
4
  import React from "react";
5
5
  import { Modal, TouchableOpacity, FlatList } from "react-native";
@@ -20,11 +20,12 @@ import { Button } from "../../button";
20
20
  //typing
21
21
 
22
22
  // atividades
23
- import { activities } from "./data-activities";
23
+ import { getActivitiesByType } from "./helpers";
24
24
  export const ModalActivities = ({
25
25
  onClose,
26
26
  handleActivity,
27
27
  activityType,
28
+ driverType = "carregador",
28
29
  isLoading,
29
30
  style
30
31
  }) => {
@@ -79,7 +80,7 @@ export const ModalActivities = ({
79
80
  marginTop: theme.margins["2xl"]
80
81
  }
81
82
  }, /*#__PURE__*/React.createElement(FlatList, {
82
- data: activities[activityType],
83
+ data: getActivitiesByType(driverType, activityType),
83
84
  numColumns: 3,
84
85
  keyExtractor: item => item.id.toString(),
85
86
  scrollEnabled: false,
@@ -1 +1 @@
1
- {"version":3,"names":["React","Modal","TouchableOpacity","FlatList","Box","Icons","getIconModalActivities","theme","Typography","Button","activities","ModalActivities","onClose","handleActivity","activityType","isLoading","style","createElement","animationType","transparent","onRequestClose","backgroundColor","flexStyle","flex","justifyContent","alignItems","height","width","colors","neutral","borderStyled","borderColor","blue","borderWidth","borderWidths","thick","borderRadius","thick_medium","paddingStyle","padding","paddings","md","position","flexDirection","text","size","fontSizes","color","fontFamily","fonts","inter_bold_700","lineHeight","xl","activeOpacity","onPress","icon","marginStyle","marginTop","margins","data","numColumns","keyExtractor","item","id","toString","scrollEnabled","renderItem","marginBottom","referencia","descricao","xs","inter_medium_500","fontWeight","align","title","buttonTextStyle","fontSize","thin","marginLeft","bottom","left"],"sources":["index.tsx"],"sourcesContent":["/**\r\n * IMPORTS\r\n */\r\nimport React from \"react\";\r\nimport { Modal, TouchableOpacity, FlatList } from \"react-native\";\r\n\r\n// components\r\n\r\nimport Box from \"../../box\";\r\n\r\n// commons / icons\r\nimport { Icons } from \"../../../common/icons-svg\";\r\nimport { getIconModalActivities } from \"../../../common/icons-svg/modal-activities\";\r\n\r\n// styles\r\nimport { theme } from \"../../../styles/theme/theme\";\r\nimport { Typography } from \"../../typography\";\r\nimport { Button } from \"../../button\";\r\n\r\n//typing\r\nimport { IModalActivities, IActivity } from \"./interface\";\r\n\r\n// atividades\r\nimport { activities } from \"./data-activities\";\r\n\r\nexport const ModalActivities: React.FC<IModalActivities> = ({\r\n onClose,\r\n handleActivity,\r\n activityType,\r\n isLoading,\r\n style,\r\n}) => {\r\n return (\r\n <Modal animationType=\"fade\" transparent={true} onRequestClose={onClose}>\r\n <Box\r\n backgroundColor={\"rgba(0, 0, 0, 0.7)\"}\r\n flexStyle={{ flex: 1, justifyContent: \"center\", alignItems: \"center\" }}\r\n >\r\n <Box\r\n height={310}\r\n width={\"92%\"}\r\n backgroundColor={theme.colors.neutral[25]}\r\n borderStyled={{\r\n borderColor: theme.colors.blue[500],\r\n borderWidth: theme.borderWidths.thick,\r\n borderRadius: theme.borderWidths.thick_medium,\r\n }}\r\n paddingStyle={{\r\n padding: theme.paddings.md,\r\n }}\r\n style={{ position: \"relative\" }}\r\n >\r\n <Box\r\n width={\"100%\"}\r\n flexStyle={{\r\n flexDirection: \"row\",\r\n justifyContent: \"space-between\",\r\n alignItems: \"center\",\r\n }}\r\n >\r\n <Typography\r\n text=\"Atividades\"\r\n size={theme.fontSizes.md}\r\n color={theme.colors.blue[500]}\r\n fontFamily={theme.fonts.inter_bold_700}\r\n lineHeight={theme.fontSizes.xl}\r\n />\r\n\r\n <TouchableOpacity activeOpacity={0.7} onPress={onClose} style={{}}>\r\n <Icons icon=\"CLOSED\" color={theme.colors.blue[500]} />\r\n </TouchableOpacity>\r\n </Box>\r\n {/* as atividades */}\r\n <Box marginStyle={{ marginTop: theme.margins[\"2xl\"] }}>\r\n <FlatList\r\n data={activities[activityType]}\r\n numColumns={3}\r\n keyExtractor={(item) => item.id.toString()}\r\n scrollEnabled={false}\r\n renderItem={({ item }) => (\r\n <TouchableOpacity\r\n style={{\r\n alignItems: \"center\",\r\n width: 110,\r\n marginBottom: theme.margins[\"2xl\"], // espaço entre as linhas\r\n }}\r\n onPress={() => handleActivity(item as IActivity)}\r\n >\r\n {getIconModalActivities(item.referencia)}\r\n\r\n <Typography\r\n text={item.descricao}\r\n size={theme.fontSizes.xs}\r\n color={theme.colors.blue[500]}\r\n lineHeight={theme.fontSizes.md}\r\n fontFamily={theme.fonts.inter_medium_500}\r\n fontWeight=\"500\"\r\n align=\"center\"\r\n marginTop={5}\r\n />\r\n </TouchableOpacity>\r\n )}\r\n />\r\n </Box>\r\n\r\n <Button\r\n title={\"CANCELAR ATIVIDADE\"}\r\n width=\"100%\"\r\n height={40}\r\n activeOpacity={0.7}\r\n onPress={onClose}\r\n backgroundColor={theme.colors.blue[500]}\r\n buttonTextStyle={{\r\n color: theme.colors.neutral[25],\r\n fontFamily: theme.fonts.inter_medium_500,\r\n fontSize: theme.fontSizes.md,\r\n fontWeight: \"500\",\r\n }}\r\n flexStyle={{\r\n flexDirection: \"row\",\r\n alignItems: \"center\",\r\n justifyContent: \"center\",\r\n }}\r\n borderStyled={{\r\n borderWidth: theme.borderWidths.thin,\r\n borderColor: theme.colors.blue[500],\r\n borderRadius: theme.borderWidths.thick_medium,\r\n }}\r\n marginStyle={{ marginLeft: theme.margins.md }}\r\n isLoading={isLoading ?? false}\r\n style={[style, { position: \"absolute\", bottom: 10, left: 0 }]}\r\n />\r\n </Box>\r\n </Box>\r\n </Modal>\r\n );\r\n};\r\n"],"mappings":"AAAA;AACA;AACA;AACA,OAAOA,KAAK,MAAM,OAAO;AACzB,SAASC,KAAK,EAAEC,gBAAgB,EAAEC,QAAQ,QAAQ,cAAc;;AAEhE;;AAEA,OAAOC,GAAG,MAAM,WAAW;;AAE3B;AACA,SAASC,KAAK,QAAQ,2BAA2B;AACjD,SAASC,sBAAsB,QAAQ,4CAA4C;;AAEnF;AACA,SAASC,KAAK,QAAQ,6BAA6B;AACnD,SAASC,UAAU,QAAQ,kBAAkB;AAC7C,SAASC,MAAM,QAAQ,cAAc;;AAErC;;AAGA;AACA,SAASC,UAAU,QAAQ,mBAAmB;AAE9C,OAAO,MAAMC,eAA2C,GAAGA,CAAC;EAC1DC,OAAO;EACPC,cAAc;EACdC,YAAY;EACZC,SAAS;EACTC;AACF,CAAC,KAAK;EACJ,oBACEhB,KAAA,CAAAiB,aAAA,CAAChB,KAAK;IAACiB,aAAa,EAAC,MAAM;IAACC,WAAW,EAAE,IAAK;IAACC,cAAc,EAAER;EAAQ,gBACrEZ,KAAA,CAAAiB,aAAA,CAACb,GAAG;IACFiB,eAAe,EAAE,oBAAqB;IACtCC,SAAS,EAAE;MAAEC,IAAI,EAAE,CAAC;MAAEC,cAAc,EAAE,QAAQ;MAAEC,UAAU,EAAE;IAAS;EAAE,gBAEvEzB,KAAA,CAAAiB,aAAA,CAACb,GAAG;IACFsB,MAAM,EAAE,GAAI;IACZC,KAAK,EAAE,KAAM;IACbN,eAAe,EAAEd,KAAK,CAACqB,MAAM,CAACC,OAAO,CAAC,EAAE,CAAE;IAC1CC,YAAY,EAAE;MACZC,WAAW,EAAExB,KAAK,CAACqB,MAAM,CAACI,IAAI,CAAC,GAAG,CAAC;MACnCC,WAAW,EAAE1B,KAAK,CAAC2B,YAAY,CAACC,KAAK;MACrCC,YAAY,EAAE7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,EAAErE,KAAK,CAACuC,SAAS,CAACL,EAAE;MAC5B+B,UAAU,EAAE;IACd,CAAE;IACFlD,SAAS,EAAE;MACTqB,aAAa,EAAE,KAAK;MACpBlB,UAAU,EAAE,QAAQ;MACpBD,cAAc,EAAE;IAClB,CAAE;IACFM,YAAY,EAAE;MACZG,WAAW,EAAE1B,KAAK,CAAC2B,YAAY,CAAC2C,IAAI;MACpC9C,WAAW,EAAExB,KAAK,CAACqB,MAAM,CAACI,IAAI,CAAC,GAAG,CAAC;MACnCI,YAAY,EAAE7B,KAAK,CAAC2B,YAAY,CAACG;IACnC,CAAE;IACFmB,WAAW,EAAE;MAAEsB,UAAU,EAAEvE,KAAK,CAACmD,OAAO,CAACjB;IAAG,CAAE;IAC9C1B,SAAS,EAAEA,SAAS,aAATA,SAAS,cAATA,SAAS,GAAI,KAAM;IAC9BC,KAAK,EAAE,CAACA,KAAK,EAAE;MAAE0B,QAAQ,EAAE,UAAU;MAAEqC,MAAM,EAAE,EAAE;MAAEC,IAAI,EAAE;IAAE,CAAC;EAAE,CAC/D,CACE,CACF,CACA,CAAC;AAEZ,CAAC","ignoreList":[]}
1
+ {"version":3,"names":["React","Modal","TouchableOpacity","FlatList","Box","Icons","getIconModalActivities","theme","Typography","Button","getActivitiesByType","ModalActivities","onClose","handleActivity","activityType","driverType","isLoading","style","createElement","animationType","transparent","onRequestClose","backgroundColor","flexStyle","flex","justifyContent","alignItems","height","width","colors","neutral","borderStyled","borderColor","blue","borderWidth","borderWidths","thick","borderRadius","thick_medium","paddingStyle","padding","paddings","md","position","flexDirection","text","size","fontSizes","color","fontFamily","fonts","inter_bold_700","lineHeight","xl","activeOpacity","onPress","icon","marginStyle","marginTop","margins","data","numColumns","keyExtractor","item","id","toString","scrollEnabled","renderItem","marginBottom","referencia","descricao","xs","inter_medium_500","fontWeight","align","title","buttonTextStyle","fontSize","thin","marginLeft","bottom","left"],"sources":["index.tsx"],"sourcesContent":["/**\n * IMPORTS\n */\nimport React from \"react\";\nimport { Modal, TouchableOpacity, FlatList } from \"react-native\";\n\n// components\n\nimport Box from \"../../box\";\n\n// commons / icons\nimport { Icons } from \"../../../common/icons-svg\";\nimport { getIconModalActivities } from \"../../../common/icons-svg/modal-activities\";\n\n// styles\nimport { theme } from \"../../../styles/theme/theme\";\nimport { Typography } from \"../../typography\";\nimport { Button } from \"../../button\";\n\n//typing\nimport { IModalActivities, IActivity } from \"./interface\";\n\n// atividades\nimport { getActivitiesByType } from \"./helpers\";\n\nexport const ModalActivities: React.FC<IModalActivities> = ({\n onClose,\n handleActivity,\n activityType,\n driverType = \"carregador\",\n isLoading,\n style,\n}) => {\n return (\n <Modal animationType=\"fade\" transparent={true} onRequestClose={onClose}>\n <Box\n backgroundColor={\"rgba(0, 0, 0, 0.7)\"}\n flexStyle={{ flex: 1, justifyContent: \"center\", alignItems: \"center\" }}\n >\n <Box\n height={310}\n width={\"92%\"}\n backgroundColor={theme.colors.neutral[25]}\n borderStyled={{\n borderColor: theme.colors.blue[500],\n borderWidth: theme.borderWidths.thick,\n borderRadius: theme.borderWidths.thick_medium,\n }}\n paddingStyle={{\n padding: theme.paddings.md,\n }}\n style={{ position: \"relative\" }}\n >\n <Box\n width={\"100%\"}\n flexStyle={{\n flexDirection: \"row\",\n justifyContent: \"space-between\",\n alignItems: \"center\",\n }}\n >\n <Typography\n text=\"Atividades\"\n size={theme.fontSizes.md}\n color={theme.colors.blue[500]}\n fontFamily={theme.fonts.inter_bold_700}\n lineHeight={theme.fontSizes.xl}\n />\n\n <TouchableOpacity activeOpacity={0.7} onPress={onClose} style={{}}>\n <Icons icon=\"CLOSED\" color={theme.colors.blue[500]} />\n </TouchableOpacity>\n </Box>\n {/* as atividades */}\n <Box marginStyle={{ marginTop: theme.margins[\"2xl\"] }}>\n <FlatList\n data={getActivitiesByType(driverType, activityType)}\n numColumns={3}\n keyExtractor={(item) => item.id.toString()}\n scrollEnabled={false}\n renderItem={({ item }) => (\n <TouchableOpacity\n style={{\n alignItems: \"center\",\n width: 110,\n marginBottom: theme.margins[\"2xl\"], // espaço entre as linhas\n }}\n onPress={() => handleActivity(item as IActivity)}\n >\n {getIconModalActivities(item.referencia)}\n\n <Typography\n text={item.descricao}\n size={theme.fontSizes.xs}\n color={theme.colors.blue[500]}\n lineHeight={theme.fontSizes.md}\n fontFamily={theme.fonts.inter_medium_500}\n fontWeight=\"500\"\n align=\"center\"\n marginTop={5}\n />\n </TouchableOpacity>\n )}\n />\n </Box>\n\n <Button\n title={\"CANCELAR ATIVIDADE\"}\n width=\"100%\"\n height={40}\n activeOpacity={0.7}\n onPress={onClose}\n backgroundColor={theme.colors.blue[500]}\n buttonTextStyle={{\n color: theme.colors.neutral[25],\n fontFamily: theme.fonts.inter_medium_500,\n fontSize: theme.fontSizes.md,\n fontWeight: \"500\",\n }}\n flexStyle={{\n flexDirection: \"row\",\n alignItems: \"center\",\n justifyContent: \"center\",\n }}\n borderStyled={{\n borderWidth: theme.borderWidths.thin,\n borderColor: theme.colors.blue[500],\n borderRadius: theme.borderWidths.thick_medium,\n }}\n marginStyle={{ marginLeft: theme.margins.md }}\n isLoading={isLoading ?? false}\n style={[style, { position: \"absolute\", bottom: 10, left: 0 }]}\n />\n </Box>\n </Box>\n </Modal>\n );\n};\n"],"mappings":"AAAA;AACA;AACA;AACA,OAAOA,KAAK,MAAM,OAAO;AACzB,SAASC,KAAK,EAAEC,gBAAgB,EAAEC,QAAQ,QAAQ,cAAc;;AAEhE;;AAEA,OAAOC,GAAG,MAAM,WAAW;;AAE3B;AACA,SAASC,KAAK,QAAQ,2BAA2B;AACjD,SAASC,sBAAsB,QAAQ,4CAA4C;;AAEnF;AACA,SAASC,KAAK,QAAQ,6BAA6B;AACnD,SAASC,UAAU,QAAQ,kBAAkB;AAC7C,SAASC,MAAM,QAAQ,cAAc;;AAErC;;AAGA;AACA,SAASC,mBAAmB,QAAQ,WAAW;AAE/C,OAAO,MAAMC,eAA2C,GAAGA,CAAC;EAC1DC,OAAO;EACPC,cAAc;EAC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,KAAM;IAC9BC,KAAK,EAAE,CAACA,KAAK,EAAE;MAAE0B,QAAQ,EAAE,UAAU;MAAEqC,MAAM,EAAE,EAAE;MAAEC,IAAI,EAAE;IAAE,CAAC;EAAE,CAC/D,CACE,CACF,CACA,CAAC;AAEZ,CAAC","ignoreList":[]}
@@ -1 +1 @@
1
- {"version":3,"names":[],"sources":["interface.d.ts"],"sourcesContent":["/**\r\n * IMPORTS\r\n */\r\nimport { ModalProps } from \"react-native\";\r\n\r\n// typing\r\nimport { IGlobalCss } from \"../../../styles/global/interface\";\r\n\r\ninterface IActivity {\r\n id: number;\r\n referencia: string;\r\n cor_hex: string;\r\n descricao: string;\r\n tipo: \"trabalho\" | \"descanso\";\r\n}\r\n\r\ninterface IModalActivities extends ModalProps, IGlobalCss {\r\n /** função que fecha modal */\r\n onClose: () => void;\r\n\r\n /** tipo de atividades */\r\n activityType: IActivity[\"tipo\"];\r\n\r\n /** função que manda atividade selecionada */\r\n // eslint-disable-next-line no-unused-vars\r\n handleActivity: (activity: IActivity) => void;\r\n}\r\n\r\n/**\r\n * EXPORTS\r\n */\r\nexport { IModalActivities, IActivity };\r\n"],"mappings":"","ignoreList":[]}
1
+ {"version":3,"names":[],"sources":["interface.d.ts"],"sourcesContent":["/**\n * IMPORTS\n */\nimport { ModalProps } from \"react-native\";\n\n// typing\nimport { IGlobalCss } from \"../../../styles/global/interface\";\n\ninterface IActivity {\n id: number;\n referencia: string;\n cor_hex: string;\n descricao: string;\n tipo: \"trabalho\" | \"descanso\";\n}\n\ninterface IModalActivities extends ModalProps, IGlobalCss {\n /** função que fecha modal */\n onClose: () => void;\n\n /** tipo de atividades */\n activityType: IActivity[\"tipo\"];\n\n /** função que manda atividade selecionada */\n // eslint-disable-next-line no-unused-vars\n handleActivity: (activity: IActivity) => void;\n\n driverType?: \"normal\" | \"carregador\";\n}\n\n/**\n * EXPORTS\n */\nexport { IModalActivities, IActivity };\n"],"mappings":"","ignoreList":[]}
@@ -1,19 +1,14 @@
1
1
  /**
2
- * dados para os tipos de atividades selecionado
2
+ * Tipagem da atividade
3
3
  */
4
- export declare const activities: {
5
- trabalho: {
6
- id: number;
7
- referencia: string;
8
- cor_hex: string;
9
- descricao: string;
10
- tipo: string;
11
- }[];
12
- descanso: {
13
- id: number;
14
- referencia: string;
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 };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "react-native-exp-fig",
3
- "version": "0.1.29",
3
+ "version": "0.1.30",
4
4
  "description": "Biblioteca para desenvolvimento dos componentes para utilizar nos app da Expresso Figueiredo.",
5
5
  "main": "lib/commonjs/index",
6
6
  "module": "lib/module/index",
@@ -1,65 +1,95 @@
1
- /**
2
- * dados para os tipos de atividades selecionado
3
- */
4
- export const activities = {
5
- trabalho: [
6
- {
7
- id: 1,
8
- referencia: "operacao_veiculo",
9
- cor_hex: "000000",
10
- descricao: "Operação com Veículo",
11
- tipo: "trabalho",
12
- },
13
- {
14
- id: 2,
15
- referencia: "aguardando_carga",
16
- cor_hex: "000000",
17
- descricao: "Em carga",
18
- tipo: "trabalho",
19
- },
20
- {
21
- id: 3,
22
- referencia: "aguardando_descarga",
23
- cor_hex: "000000",
24
- descricao: "Em Descarga",
25
- tipo: "trabalho",
26
- },
27
- {
28
- id: 8,
29
- referencia: "disposicao_veiculo_parado",
30
- cor_hex: "000000",
31
- descricao: "Disposição com Veículo Parado",
32
- tipo: "trabalho",
33
- },
34
- ],
35
- descanso: [
36
- {
37
- id: 5,
38
- referencia: "repouso_semanal",
39
- cor_hex: "000000",
40
- descricao: "Repouso Semanal",
41
- tipo: "descanso",
42
- },
43
- {
44
- id: 6,
45
- referencia: "repouso_noturno",
46
- cor_hex: "000000",
47
- descricao: "Repouso Noturno",
48
- tipo: "descanso",
49
- },
50
- {
51
- id: 7,
52
- referencia: "refeicao",
53
- cor_hex: "000000",
54
- descricao: "Refeição",
55
- tipo: "descanso",
56
- },
57
- {
58
- id: 9,
59
- referencia: "descanso",
60
- cor_hex: "000000",
61
- descricao: "Descanso",
62
- tipo: "descanso",
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 { activities } from "./data-activities";
25
-
26
- export const ModalActivities: React.FC<IModalActivities> = ({
27
- onClose,
28
- handleActivity,
29
- activityType,
30
- isLoading,
31
- style,
32
- }) => {
33
- return (
34
- <Modal animationType="fade" transparent={true} onRequestClose={onClose}>
35
- <Box
36
- backgroundColor={"rgba(0, 0, 0, 0.7)"}
37
- flexStyle={{ flex: 1, justifyContent: "center", alignItems: "center" }}
38
- >
39
- <Box
40
- height={310}
41
- width={"92%"}
42
- backgroundColor={theme.colors.neutral[25]}
43
- borderStyled={{
44
- borderColor: theme.colors.blue[500],
45
- borderWidth: theme.borderWidths.thick,
46
- borderRadius: theme.borderWidths.thick_medium,
47
- }}
48
- paddingStyle={{
49
- padding: theme.paddings.md,
50
- }}
51
- style={{ position: "relative" }}
52
- >
53
- <Box
54
- width={"100%"}
55
- flexStyle={{
56
- flexDirection: "row",
57
- justifyContent: "space-between",
58
- alignItems: "center",
59
- }}
60
- >
61
- <Typography
62
- text="Atividades"
63
- size={theme.fontSizes.md}
64
- color={theme.colors.blue[500]}
65
- fontFamily={theme.fonts.inter_bold_700}
66
- lineHeight={theme.fontSizes.xl}
67
- />
68
-
69
- <TouchableOpacity activeOpacity={0.7} onPress={onClose} style={{}}>
70
- <Icons icon="CLOSED" color={theme.colors.blue[500]} />
71
- </TouchableOpacity>
72
- </Box>
73
- {/* as atividades */}
74
- <Box marginStyle={{ marginTop: theme.margins["2xl"] }}>
75
- <FlatList
76
- data={activities[activityType]}
77
- numColumns={3}
78
- keyExtractor={(item) => item.id.toString()}
79
- scrollEnabled={false}
80
- renderItem={({ item }) => (
81
- <TouchableOpacity
82
- style={{
83
- alignItems: "center",
84
- width: 110,
85
- marginBottom: theme.margins["2xl"], // espaço entre as linhas
86
- }}
87
- onPress={() => handleActivity(item as IActivity)}
88
- >
89
- {getIconModalActivities(item.referencia)}
90
-
91
- <Typography
92
- text={item.descricao}
93
- size={theme.fontSizes.xs}
94
- color={theme.colors.blue[500]}
95
- lineHeight={theme.fontSizes.md}
96
- fontFamily={theme.fonts.inter_medium_500}
97
- fontWeight="500"
98
- align="center"
99
- marginTop={5}
100
- />
101
- </TouchableOpacity>
102
- )}
103
- />
104
- </Box>
105
-
106
- <Button
107
- title={"CANCELAR ATIVIDADE"}
108
- width="100%"
109
- height={40}
110
- activeOpacity={0.7}
111
- onPress={onClose}
112
- backgroundColor={theme.colors.blue[500]}
113
- buttonTextStyle={{
114
- color: theme.colors.neutral[25],
115
- fontFamily: theme.fonts.inter_medium_500,
116
- fontSize: theme.fontSizes.md,
117
- fontWeight: "500",
118
- }}
119
- flexStyle={{
120
- flexDirection: "row",
121
- alignItems: "center",
122
- justifyContent: "center",
123
- }}
124
- borderStyled={{
125
- borderWidth: theme.borderWidths.thin,
126
- borderColor: theme.colors.blue[500],
127
- borderRadius: theme.borderWidths.thick_medium,
128
- }}
129
- marginStyle={{ marginLeft: theme.margins.md }}
130
- isLoading={isLoading ?? false}
131
- style={[style, { position: "absolute", bottom: 10, left: 0 }]}
132
- />
133
- </Box>
134
- </Box>
135
- </Modal>
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
- * EXPORTS
31
- */
32
- export { IModalActivities, IActivity };
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 };