jornada-ui 2.0.3 → 2.0.5
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/notification-details-card/index.js +13 -84
- package/lib/commonjs/components/notification-details-card/index.js.map +1 -1
- package/lib/module/components/notification-details-card/index.js +13 -84
- package/lib/module/components/notification-details-card/index.js.map +1 -1
- package/lib/typescript/commonjs/src/components/notification-details-card/index.d.ts +0 -3
- package/lib/typescript/commonjs/src/components/notification-details-card/index.d.ts.map +1 -1
- package/lib/typescript/module/src/components/notification-details-card/index.d.ts +0 -3
- package/lib/typescript/module/src/components/notification-details-card/index.d.ts.map +1 -1
- package/package.json +1 -2
- package/src/components/notification-details-card/index.tsx +22 -102
|
@@ -6,7 +6,6 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
6
6
|
exports.default = void 0;
|
|
7
7
|
var _react = _interopRequireWildcard(require("react"));
|
|
8
8
|
var _reactNative = require("react-native");
|
|
9
|
-
var _expoVideo = require("expo-video");
|
|
10
9
|
var _index = require("../../common/icons-svg/index.js");
|
|
11
10
|
var _index2 = _interopRequireDefault(require("../box/index.js"));
|
|
12
11
|
var _index3 = _interopRequireDefault(require("../typography/index.js"));
|
|
@@ -32,15 +31,9 @@ const NotificationDetailCard = /*#__PURE__*/(0, _react.forwardRef)(({
|
|
|
32
31
|
testID
|
|
33
32
|
}, ref) => {
|
|
34
33
|
const [visible, setVisible] = (0, _react.useState)(false);
|
|
35
|
-
|
|
36
|
-
// player do expo-video (inline)
|
|
37
|
-
const videoPlayer = (0, _expoVideo.useVideoPlayer)(fileType === "video" && fileUrl ? fileUrl : "undefined", player => {
|
|
38
|
-
player.loop = false;
|
|
39
|
-
player.muted = false;
|
|
40
|
-
});
|
|
41
34
|
function openFile() {
|
|
42
35
|
if (!isInternetReachable) return;
|
|
43
|
-
if (fileType === "image"
|
|
36
|
+
if (fileType === "image") {
|
|
44
37
|
setVisible(true);
|
|
45
38
|
return;
|
|
46
39
|
}
|
|
@@ -95,7 +88,7 @@ const NotificationDetailCard = /*#__PURE__*/(0, _react.forwardRef)(({
|
|
|
95
88
|
lineHeight: _theme.theme.lineHeight.md,
|
|
96
89
|
color: _theme.theme.colors.gray[700],
|
|
97
90
|
marginBottom: fileUrl ? 12 : 0
|
|
98
|
-
}), fileUrl && /*#__PURE__*/(0, _jsxRuntime.
|
|
91
|
+
}), fileUrl && /*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNative.TouchableOpacity, {
|
|
99
92
|
testID: "button",
|
|
100
93
|
onPress: openFile,
|
|
101
94
|
activeOpacity: 0.8,
|
|
@@ -106,72 +99,17 @@ const NotificationDetailCard = /*#__PURE__*/(0, _react.forwardRef)(({
|
|
|
106
99
|
borderWidth: 1,
|
|
107
100
|
borderColor: isInternetReachable ? _theme.theme.colors.gray[300] : _theme.theme.colors.red[900]
|
|
108
101
|
},
|
|
109
|
-
children: fileType === "image"
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
borderColor: isInternetReachable ? _theme.theme.colors.blue[525] : _theme.theme.colors.red[900],
|
|
113
|
-
borderRadius: _theme.theme.borderWidths.thick_medium
|
|
102
|
+
children: [fileType === "image" && /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Image, {
|
|
103
|
+
source: {
|
|
104
|
+
uri: fileUrl
|
|
114
105
|
},
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
uri: fileUrl
|
|
118
|
-
},
|
|
119
|
-
style: {
|
|
120
|
-
width: "100%",
|
|
121
|
-
height: 180,
|
|
122
|
-
borderRadius: _theme.theme.borderWidths.thick_medium
|
|
123
|
-
},
|
|
124
|
-
resizeMode: "cover"
|
|
125
|
-
}) : /*#__PURE__*/(0, _jsxRuntime.jsxs)(_index2.default, {
|
|
106
|
+
style: {
|
|
107
|
+
width: "100%",
|
|
126
108
|
height: 180,
|
|
127
|
-
flexStyle: {
|
|
128
|
-
alignItems: "center",
|
|
129
|
-
justifyContent: "center"
|
|
130
|
-
},
|
|
131
|
-
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_index.Icons, {
|
|
132
|
-
icon: "WIFI_X",
|
|
133
|
-
size: 20,
|
|
134
|
-
color: _theme.theme.colors.red[900]
|
|
135
|
-
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_index3.default, {
|
|
136
|
-
text: "Imagem indispon\xEDvel",
|
|
137
|
-
size: _theme.theme.fontSizes.sm,
|
|
138
|
-
color: _theme.theme.colors.gray[700]
|
|
139
|
-
})]
|
|
140
|
-
})
|
|
141
|
-
}) : fileType === "video" ? /*#__PURE__*/(0, _jsxRuntime.jsx)(_index2.default, {
|
|
142
|
-
height: 180,
|
|
143
|
-
borderStyled: {
|
|
144
|
-
borderWidth: 2,
|
|
145
|
-
borderColor: isInternetReachable ? _theme.theme.colors.blue[525] : _theme.theme.colors.red[900],
|
|
146
109
|
borderRadius: _theme.theme.borderWidths.thick_medium
|
|
147
110
|
},
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
style: {
|
|
151
|
-
width: "100%",
|
|
152
|
-
height: "100%"
|
|
153
|
-
},
|
|
154
|
-
fullscreenOptions: {
|
|
155
|
-
enable: true
|
|
156
|
-
},
|
|
157
|
-
allowsPictureInPicture: true
|
|
158
|
-
}) : /*#__PURE__*/(0, _jsxRuntime.jsxs)(_index2.default, {
|
|
159
|
-
flexStyle: {
|
|
160
|
-
flex: 1,
|
|
161
|
-
alignItems: "center",
|
|
162
|
-
justifyContent: "center"
|
|
163
|
-
},
|
|
164
|
-
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_index.Icons, {
|
|
165
|
-
icon: "WIFI_X",
|
|
166
|
-
size: 20,
|
|
167
|
-
color: _theme.theme.colors.red[900]
|
|
168
|
-
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_index3.default, {
|
|
169
|
-
text: "V\xEDdeo indispon\xEDvel",
|
|
170
|
-
size: _theme.theme.fontSizes.sm,
|
|
171
|
-
color: _theme.theme.colors.gray[700]
|
|
172
|
-
})]
|
|
173
|
-
})
|
|
174
|
-
}) : /*#__PURE__*/(0, _jsxRuntime.jsxs)(_index2.default, {
|
|
111
|
+
resizeMode: "cover"
|
|
112
|
+
}), fileType !== "image" && fileType !== "video" && /*#__PURE__*/(0, _jsxRuntime.jsxs)(_index2.default, {
|
|
175
113
|
flexStyle: {
|
|
176
114
|
flexDirection: "row",
|
|
177
115
|
alignItems: "center",
|
|
@@ -181,20 +119,16 @@ const NotificationDetailCard = /*#__PURE__*/(0, _react.forwardRef)(({
|
|
|
181
119
|
padding: _theme.theme.paddings.sm
|
|
182
120
|
},
|
|
183
121
|
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_index3.default, {
|
|
184
|
-
text:
|
|
122
|
+
text: `Abrir arquivo (${fileType.toUpperCase()})`,
|
|
185
123
|
fontFamily: _theme.theme.fonts.inter_medium_500,
|
|
186
124
|
color: _theme.theme.colors.blue[500],
|
|
187
125
|
size: _theme.theme.fontSizes.md
|
|
188
|
-
}),
|
|
126
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_index.Icons, {
|
|
189
127
|
icon: "FILES",
|
|
190
128
|
size: 20,
|
|
191
129
|
color: _theme.theme.colors.blue[500]
|
|
192
|
-
}) : /*#__PURE__*/(0, _jsxRuntime.jsx)(_index.Icons, {
|
|
193
|
-
icon: "WIFI_X",
|
|
194
|
-
size: 20,
|
|
195
|
-
color: _theme.theme.colors.red[900]
|
|
196
130
|
})]
|
|
197
|
-
})
|
|
131
|
+
})]
|
|
198
132
|
})]
|
|
199
133
|
}), fileType === "image" && /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Modal, {
|
|
200
134
|
visible: visible,
|
|
@@ -225,8 +159,7 @@ const NotificationDetailCard = /*#__PURE__*/(0, _react.forwardRef)(({
|
|
|
225
159
|
},
|
|
226
160
|
style: {
|
|
227
161
|
width: "90%",
|
|
228
|
-
height: "70%"
|
|
229
|
-
borderRadius: _theme.theme.borderWidths.thick_medium
|
|
162
|
+
height: "70%"
|
|
230
163
|
},
|
|
231
164
|
resizeMode: "contain"
|
|
232
165
|
})]
|
|
@@ -235,9 +168,5 @@ const NotificationDetailCard = /*#__PURE__*/(0, _react.forwardRef)(({
|
|
|
235
168
|
});
|
|
236
169
|
});
|
|
237
170
|
NotificationDetailCard.displayName = "NotificationDetailCard";
|
|
238
|
-
|
|
239
|
-
/**
|
|
240
|
-
* EXPORTS
|
|
241
|
-
*/
|
|
242
171
|
var _default = exports.default = (0, _asBaseComponent.asBaseComponent)(NotificationDetailCard);
|
|
243
172
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_react","_interopRequireWildcard","require","_reactNative","
|
|
1
|
+
{"version":3,"names":["_react","_interopRequireWildcard","require","_reactNative","_index","_index2","_interopRequireDefault","_index3","_asBaseComponent","_theme","_jsxRuntime","e","__esModule","default","t","WeakMap","r","n","o","i","f","__proto__","has","get","set","hasOwnProperty","call","Object","defineProperty","getOwnPropertyDescriptor","NotificationDetailCard","forwardRef","isInternetReachable","title","description","fileUrl","fileType","testID","ref","visible","setVisible","useState","openFile","Promise","resolve","then","Linking","openURL","catch","err","console","warn","borderColor","theme","colors","blue","jsxs","flexStyle","flexDirection","borderStyled","borderWidth","neutral","borderRadius","borderWidths","thick_medium","marginStyle","marginBottom","backgroundColor","children","jsx","width","borderTopLeftRadius","borderBottomLeftRadius","flex","paddingStyle","padding","paddings","md","text","fontFamily","fonts","inter_bold","fontWeight","size","fontSizes","color","black","sm","lineHeight","gray","TouchableOpacity","onPress","activeOpacity","disabled","style","overflow","red","Image","source","uri","height","resizeMode","alignItems","justifyContent","toUpperCase","inter_medium_500","Icons","icon","Modal","transparent","animationType","View","position","top","right","displayName","_default","exports","asBaseComponent"],"sourceRoot":"..\\..\\..\\..\\src","sources":["components/notification-details-card/index.tsx"],"mappings":";;;;;;AAGA,IAAAA,MAAA,GAAAC,uBAAA,CAAAC,OAAA;AACA,IAAAC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MAAA,CAAAsG,KAAK;YAACC,IAAI,EAAC,QAAQ;YAACxB,IAAI,EAAE,EAAG;YAACE,KAAK,EAAEhC,YAAK,CAACC,MAAM,CAACO,OAAO,CAAC,EAAE;UAAE,CAAE;QAAC,CAClD,CAAC,eAEnB,IAAAnD,WAAA,CAAA2D,GAAA,EAAClE,YAAA,CAAA8F,KAAK;UACJC,MAAM,EAAE;YAAEC,GAAG,EAAEhE;UAAQ,CAAE;UACzB2D,KAAK,EAAE;YAAExB,KAAK,EAAE,KAAK;YAAE8B,MAAM,EAAE;UAAM,CAAE;UACvCC,UAAU,EAAC;QAAS,CACrB,CAAC;MAAA,CACE;IAAC,CACF,CACR;EAAA,CACE,CAAC;AAEV,CACF,CAAC;AAEDvE,sBAAsB,CAACqF,WAAW,GAAG,wBAAwB;AAAC,IAAAC,QAAA,GAAAC,OAAA,CAAAxG,OAAA,GAE/C,IAAAyG,gCAAe,EAACxF,sBAAsB,CAAC","ignoreList":[]}
|
|
@@ -5,7 +5,6 @@
|
|
|
5
5
|
*/
|
|
6
6
|
import React, { forwardRef, useState } from "react";
|
|
7
7
|
import { Modal, TouchableOpacity, Image, View } from "react-native";
|
|
8
|
-
import { VideoView, useVideoPlayer } from "expo-video";
|
|
9
8
|
|
|
10
9
|
// commons / icons
|
|
11
10
|
import { Icons } from "../../common/icons-svg/index.js";
|
|
@@ -34,15 +33,9 @@ const NotificationDetailCard = /*#__PURE__*/forwardRef(({
|
|
|
34
33
|
testID
|
|
35
34
|
}, ref) => {
|
|
36
35
|
const [visible, setVisible] = useState(false);
|
|
37
|
-
|
|
38
|
-
// player do expo-video (inline)
|
|
39
|
-
const videoPlayer = useVideoPlayer(fileType === "video" && fileUrl ? fileUrl : "undefined", player => {
|
|
40
|
-
player.loop = false;
|
|
41
|
-
player.muted = false;
|
|
42
|
-
});
|
|
43
36
|
function openFile() {
|
|
44
37
|
if (!isInternetReachable) return;
|
|
45
|
-
if (fileType === "image"
|
|
38
|
+
if (fileType === "image") {
|
|
46
39
|
setVisible(true);
|
|
47
40
|
return;
|
|
48
41
|
}
|
|
@@ -97,7 +90,7 @@ const NotificationDetailCard = /*#__PURE__*/forwardRef(({
|
|
|
97
90
|
lineHeight: theme.lineHeight.md,
|
|
98
91
|
color: theme.colors.gray[700],
|
|
99
92
|
marginBottom: fileUrl ? 12 : 0
|
|
100
|
-
}), fileUrl && /*#__PURE__*/
|
|
93
|
+
}), fileUrl && /*#__PURE__*/_jsxs(TouchableOpacity, {
|
|
101
94
|
testID: "button",
|
|
102
95
|
onPress: openFile,
|
|
103
96
|
activeOpacity: 0.8,
|
|
@@ -108,72 +101,17 @@ const NotificationDetailCard = /*#__PURE__*/forwardRef(({
|
|
|
108
101
|
borderWidth: 1,
|
|
109
102
|
borderColor: isInternetReachable ? theme.colors.gray[300] : theme.colors.red[900]
|
|
110
103
|
},
|
|
111
|
-
children: fileType === "image"
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
borderColor: isInternetReachable ? theme.colors.blue[525] : theme.colors.red[900],
|
|
115
|
-
borderRadius: theme.borderWidths.thick_medium
|
|
104
|
+
children: [fileType === "image" && /*#__PURE__*/_jsx(Image, {
|
|
105
|
+
source: {
|
|
106
|
+
uri: fileUrl
|
|
116
107
|
},
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
uri: fileUrl
|
|
120
|
-
},
|
|
121
|
-
style: {
|
|
122
|
-
width: "100%",
|
|
123
|
-
height: 180,
|
|
124
|
-
borderRadius: theme.borderWidths.thick_medium
|
|
125
|
-
},
|
|
126
|
-
resizeMode: "cover"
|
|
127
|
-
}) : /*#__PURE__*/_jsxs(Box, {
|
|
108
|
+
style: {
|
|
109
|
+
width: "100%",
|
|
128
110
|
height: 180,
|
|
129
|
-
flexStyle: {
|
|
130
|
-
alignItems: "center",
|
|
131
|
-
justifyContent: "center"
|
|
132
|
-
},
|
|
133
|
-
children: [/*#__PURE__*/_jsx(Icons, {
|
|
134
|
-
icon: "WIFI_X",
|
|
135
|
-
size: 20,
|
|
136
|
-
color: theme.colors.red[900]
|
|
137
|
-
}), /*#__PURE__*/_jsx(Typography, {
|
|
138
|
-
text: "Imagem indispon\xEDvel",
|
|
139
|
-
size: theme.fontSizes.sm,
|
|
140
|
-
color: theme.colors.gray[700]
|
|
141
|
-
})]
|
|
142
|
-
})
|
|
143
|
-
}) : fileType === "video" ? /*#__PURE__*/_jsx(Box, {
|
|
144
|
-
height: 180,
|
|
145
|
-
borderStyled: {
|
|
146
|
-
borderWidth: 2,
|
|
147
|
-
borderColor: isInternetReachable ? theme.colors.blue[525] : theme.colors.red[900],
|
|
148
111
|
borderRadius: theme.borderWidths.thick_medium
|
|
149
112
|
},
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
style: {
|
|
153
|
-
width: "100%",
|
|
154
|
-
height: "100%"
|
|
155
|
-
},
|
|
156
|
-
fullscreenOptions: {
|
|
157
|
-
enable: true
|
|
158
|
-
},
|
|
159
|
-
allowsPictureInPicture: true
|
|
160
|
-
}) : /*#__PURE__*/_jsxs(Box, {
|
|
161
|
-
flexStyle: {
|
|
162
|
-
flex: 1,
|
|
163
|
-
alignItems: "center",
|
|
164
|
-
justifyContent: "center"
|
|
165
|
-
},
|
|
166
|
-
children: [/*#__PURE__*/_jsx(Icons, {
|
|
167
|
-
icon: "WIFI_X",
|
|
168
|
-
size: 20,
|
|
169
|
-
color: theme.colors.red[900]
|
|
170
|
-
}), /*#__PURE__*/_jsx(Typography, {
|
|
171
|
-
text: "V\xEDdeo indispon\xEDvel",
|
|
172
|
-
size: theme.fontSizes.sm,
|
|
173
|
-
color: theme.colors.gray[700]
|
|
174
|
-
})]
|
|
175
|
-
})
|
|
176
|
-
}) : /*#__PURE__*/_jsxs(Box, {
|
|
113
|
+
resizeMode: "cover"
|
|
114
|
+
}), fileType !== "image" && fileType !== "video" && /*#__PURE__*/_jsxs(Box, {
|
|
177
115
|
flexStyle: {
|
|
178
116
|
flexDirection: "row",
|
|
179
117
|
alignItems: "center",
|
|
@@ -183,20 +121,16 @@ const NotificationDetailCard = /*#__PURE__*/forwardRef(({
|
|
|
183
121
|
padding: theme.paddings.sm
|
|
184
122
|
},
|
|
185
123
|
children: [/*#__PURE__*/_jsx(Typography, {
|
|
186
|
-
text:
|
|
124
|
+
text: `Abrir arquivo (${fileType.toUpperCase()})`,
|
|
187
125
|
fontFamily: theme.fonts.inter_medium_500,
|
|
188
126
|
color: theme.colors.blue[500],
|
|
189
127
|
size: theme.fontSizes.md
|
|
190
|
-
}),
|
|
128
|
+
}), /*#__PURE__*/_jsx(Icons, {
|
|
191
129
|
icon: "FILES",
|
|
192
130
|
size: 20,
|
|
193
131
|
color: theme.colors.blue[500]
|
|
194
|
-
}) : /*#__PURE__*/_jsx(Icons, {
|
|
195
|
-
icon: "WIFI_X",
|
|
196
|
-
size: 20,
|
|
197
|
-
color: theme.colors.red[900]
|
|
198
132
|
})]
|
|
199
|
-
})
|
|
133
|
+
})]
|
|
200
134
|
})]
|
|
201
135
|
}), fileType === "image" && /*#__PURE__*/_jsx(Modal, {
|
|
202
136
|
visible: visible,
|
|
@@ -227,8 +161,7 @@ const NotificationDetailCard = /*#__PURE__*/forwardRef(({
|
|
|
227
161
|
},
|
|
228
162
|
style: {
|
|
229
163
|
width: "90%",
|
|
230
|
-
height: "70%"
|
|
231
|
-
borderRadius: theme.borderWidths.thick_medium
|
|
164
|
+
height: "70%"
|
|
232
165
|
},
|
|
233
166
|
resizeMode: "contain"
|
|
234
167
|
})]
|
|
@@ -237,9 +170,5 @@ const NotificationDetailCard = /*#__PURE__*/forwardRef(({
|
|
|
237
170
|
});
|
|
238
171
|
});
|
|
239
172
|
NotificationDetailCard.displayName = "NotificationDetailCard";
|
|
240
|
-
|
|
241
|
-
/**
|
|
242
|
-
* EXPORTS
|
|
243
|
-
*/
|
|
244
173
|
export default asBaseComponent(NotificationDetailCard);
|
|
245
174
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["React","forwardRef","useState","Modal","TouchableOpacity","Image","View","
|
|
1
|
+
{"version":3,"names":["React","forwardRef","useState","Modal","TouchableOpacity","Image","View","Icons","Box","Typography","asBaseComponent","theme","jsx","_jsx","jsxs","_jsxs","NotificationDetailCard","isInternetReachable","title","description","fileUrl","fileType","testID","ref","visible","setVisible","openFile","then","Linking","openURL","catch","err","console","warn","borderColor","colors","blue","flexStyle","flexDirection","borderStyled","borderWidth","neutral","borderRadius","borderWidths","thick_medium","marginStyle","marginBottom","backgroundColor","children","width","borderTopLeftRadius","borderBottomLeftRadius","flex","paddingStyle","padding","paddings","md","text","fontFamily","fonts","inter_bold","fontWeight","size","fontSizes","color","black","sm","lineHeight","gray","onPress","activeOpacity","disabled","style","overflow","red","source","uri","height","resizeMode","alignItems","justifyContent","toUpperCase","inter_medium_500","icon","transparent","animationType","position","top","right","displayName"],"sourceRoot":"..\\..\\..\\..\\src","sources":["components/notification-details-card/index.tsx"],"mappings":";;AAAA;AACA;AACA;AACA,OAAOA,KAAK,IAAIC,UAAU,EAAEC,QAAQ,QAAQ,OAAO;AACnD,SAASC,KAAK,EAAEC,gBAAgB,EAAEC,KAAK,EAAEC,IAAI,QAAQ,cAAc;;AAEnE;AACA,SAASC,KAAK,QAAQ,iCAAwB;;AAE9C;AACA,OAAOC,GAAG,MAAM,iBAAQ;AACxB,OAAOC,UAAU,MAAM,wBAAe;;AAEtC;;AAEA,SAASC,eAAe,QAAQ,mCAAgC;;AAEhE;AACA,SAASC,KAAK,QAAQ,6BAA0B;;AAEhD;AACA;AACA;AAFA,SAAAC,GAAA,IAAAC,IAAA,EAAAC,IAAA,IAAAC,KAAA;AAGA,MAAMC,sBAA8D,gBAAGf,UAAU,CAI/E,CACE;EAAEgB,mBAAmB,GAAG,IAAI;EAAEC,KAAK;EAAEC,WAAW;EAAEC,OAAO;EAAEC,QAAQ,GAAG,OAAO;EAAEC;AAAO,CAAC,EACvFC,GAAG,KACA;EACH,MAAM,CAACC,OAAO,EAAEC,UAAU,CAAC,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PL,eAAe,EAAE,iBAAiB;UAClCiC,cAAc,EAAE,QAAQ;UACxBD,UAAU,EAAE;QACd,CAAE;QAAA/B,QAAA,gBAEFnC,IAAA,CAACT,gBAAgB;UACfiE,OAAO,EAAEA,CAAA,KAAM5C,UAAU,CAAC,KAAK,CAAE;UACjC+C,KAAK,EAAE;YAAEc,QAAQ,EAAE,UAAU;YAAEC,GAAG,EAAE,EAAE;YAAEC,KAAK,EAAE;UAAG,CAAE;UAAAxC,QAAA,eAEpDnC,IAAA,CAACN,KAAK;YAAC4E,IAAI,EAAC,QAAQ;YAACrB,IAAI,EAAE,EAAG;YAACE,KAAK,EAAErD,KAAK,CAACwB,MAAM,CAACM,OAAO,CAAC,EAAE;UAAE,CAAE;QAAC,CAClD,CAAC,eAEnB5B,IAAA,CAACR,KAAK;UACJsE,MAAM,EAAE;YAAEC,GAAG,EAAExD;UAAQ,CAAE;UACzBoD,KAAK,EAAE;YAAEvB,KAAK,EAAE,KAAK;YAAE4B,MAAM,EAAE;UAAM,CAAE;UACvCC,UAAU,EAAC;QAAS,CACrB,CAAC;MAAA,CACE;IAAC,CACF,CACR;EAAA,CACE,CAAC;AAEV,CACF,CAAC;AAED9D,sBAAsB,CAACyE,WAAW,GAAG,wBAAwB;AAE7D,eAAe/E,eAAe,CAACM,sBAAsB,CAAC","ignoreList":[]}
|
|
@@ -3,9 +3,6 @@
|
|
|
3
3
|
*/
|
|
4
4
|
import React from "react";
|
|
5
5
|
import type { INotificationDetailCardProps } from "./interface";
|
|
6
|
-
/**
|
|
7
|
-
* EXPORTS
|
|
8
|
-
*/
|
|
9
6
|
declare const _default: React.ComponentType<INotificationDetailCardProps>;
|
|
10
7
|
export default _default;
|
|
11
8
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../../src/components/notification-details-card/index.tsx"],"names":[],"mappings":"AAAA;;GAEG;AACH,OAAO,KAA+B,MAAM,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../../src/components/notification-details-card/index.tsx"],"names":[],"mappings":"AAAA;;GAEG;AACH,OAAO,KAA+B,MAAM,OAAO,CAAC;AAWpD,OAAO,KAAK,EAAE,4BAA4B,EAAE,MAAM,aAAa,CAAC;;AAmKhE,wBAAuD"}
|
|
@@ -3,9 +3,6 @@
|
|
|
3
3
|
*/
|
|
4
4
|
import React from "react";
|
|
5
5
|
import type { INotificationDetailCardProps } from "./interface";
|
|
6
|
-
/**
|
|
7
|
-
* EXPORTS
|
|
8
|
-
*/
|
|
9
6
|
declare const _default: React.ComponentType<INotificationDetailCardProps>;
|
|
10
7
|
export default _default;
|
|
11
8
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../../src/components/notification-details-card/index.tsx"],"names":[],"mappings":"AAAA;;GAEG;AACH,OAAO,KAA+B,MAAM,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../../src/components/notification-details-card/index.tsx"],"names":[],"mappings":"AAAA;;GAEG;AACH,OAAO,KAA+B,MAAM,OAAO,CAAC;AAWpD,OAAO,KAAK,EAAE,4BAA4B,EAAE,MAAM,aAAa,CAAC;;AAmKhE,wBAAuD"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "jornada-ui",
|
|
3
|
-
"version": "2.0.
|
|
3
|
+
"version": "2.0.5",
|
|
4
4
|
"description": "Biblioteca para desenvolvimento dos componentes para utilizar nos app",
|
|
5
5
|
"source": "./src/index.tsx",
|
|
6
6
|
"main": "./lib/commonjs/index.js",
|
|
@@ -80,7 +80,6 @@
|
|
|
80
80
|
"dependencies": {
|
|
81
81
|
"@react-native-community/datetimepicker": "^8.4.4",
|
|
82
82
|
"@storybook/test": "^8.3.0",
|
|
83
|
-
"expo-video": "~3.0.15",
|
|
84
83
|
"react-native-svg": "^15.11.2",
|
|
85
84
|
"react-native-web": "^0.19.12"
|
|
86
85
|
},
|
|
@@ -3,7 +3,6 @@
|
|
|
3
3
|
*/
|
|
4
4
|
import React, { forwardRef, useState } from "react";
|
|
5
5
|
import { Modal, TouchableOpacity, Image, View } from "react-native";
|
|
6
|
-
import { VideoView, useVideoPlayer } from "expo-video";
|
|
7
6
|
|
|
8
7
|
// commons / icons
|
|
9
8
|
import { Icons } from "../../common/icons-svg";
|
|
@@ -32,19 +31,10 @@ const NotificationDetailCard: React.FC<INotificationDetailCardProps> = forwardRe
|
|
|
32
31
|
) => {
|
|
33
32
|
const [visible, setVisible] = useState(false);
|
|
34
33
|
|
|
35
|
-
// player do expo-video (inline)
|
|
36
|
-
const videoPlayer = useVideoPlayer(
|
|
37
|
-
fileType === "video" && fileUrl! ? fileUrl! : "undefined",
|
|
38
|
-
(player) => {
|
|
39
|
-
player.loop = false;
|
|
40
|
-
player.muted = false;
|
|
41
|
-
}
|
|
42
|
-
);
|
|
43
|
-
|
|
44
34
|
function openFile() {
|
|
45
35
|
if (!isInternetReachable) return;
|
|
46
36
|
|
|
47
|
-
if (fileType === "image"
|
|
37
|
+
if (fileType === "image") {
|
|
48
38
|
setVisible(true);
|
|
49
39
|
return;
|
|
50
40
|
}
|
|
@@ -71,7 +61,7 @@ const NotificationDetailCard: React.FC<INotificationDetailCardProps> = forwardRe
|
|
|
71
61
|
marginStyle={{ marginBottom: 16 }}
|
|
72
62
|
backgroundColor={theme.colors.neutral[25]}
|
|
73
63
|
>
|
|
74
|
-
{/*
|
|
64
|
+
{/* Borda lateral */}
|
|
75
65
|
<Box
|
|
76
66
|
width={8}
|
|
77
67
|
backgroundColor={borderColor}
|
|
@@ -83,7 +73,7 @@ const NotificationDetailCard: React.FC<INotificationDetailCardProps> = forwardRe
|
|
|
83
73
|
|
|
84
74
|
{/* Conteúdo */}
|
|
85
75
|
<Box flexStyle={{ flex: 1 }} paddingStyle={{ padding: theme.paddings.md }}>
|
|
86
|
-
{/*
|
|
76
|
+
{/* Título */}
|
|
87
77
|
<Typography
|
|
88
78
|
text={title}
|
|
89
79
|
fontFamily={theme.fonts.inter_bold}
|
|
@@ -93,7 +83,7 @@ const NotificationDetailCard: React.FC<INotificationDetailCardProps> = forwardRe
|
|
|
93
83
|
marginBottom={8}
|
|
94
84
|
/>
|
|
95
85
|
|
|
96
|
-
{/*
|
|
86
|
+
{/* Descrição */}
|
|
97
87
|
<Typography
|
|
98
88
|
text={description}
|
|
99
89
|
size={theme.fontSizes.sm}
|
|
@@ -102,7 +92,7 @@ const NotificationDetailCard: React.FC<INotificationDetailCardProps> = forwardRe
|
|
|
102
92
|
marginBottom={fileUrl ? 12 : 0}
|
|
103
93
|
/>
|
|
104
94
|
|
|
105
|
-
{/*
|
|
95
|
+
{/* Arquivo */}
|
|
106
96
|
{fileUrl && (
|
|
107
97
|
<TouchableOpacity
|
|
108
98
|
testID="button"
|
|
@@ -116,76 +106,21 @@ const NotificationDetailCard: React.FC<INotificationDetailCardProps> = forwardRe
|
|
|
116
106
|
borderColor: isInternetReachable ? theme.colors.gray[300] : theme.colors.red[900],
|
|
117
107
|
}}
|
|
118
108
|
>
|
|
119
|
-
{
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
109
|
+
{/* IMAGEM */}
|
|
110
|
+
{fileType === "image" && (
|
|
111
|
+
<Image
|
|
112
|
+
source={{ uri: fileUrl }}
|
|
113
|
+
style={{
|
|
114
|
+
width: "100%",
|
|
115
|
+
height: 180,
|
|
126
116
|
borderRadius: theme.borderWidths.thick_medium,
|
|
127
117
|
}}
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
height: 180,
|
|
135
|
-
borderRadius: theme.borderWidths.thick_medium,
|
|
136
|
-
}}
|
|
137
|
-
resizeMode="cover"
|
|
138
|
-
/>
|
|
139
|
-
) : (
|
|
140
|
-
<Box
|
|
141
|
-
height={180}
|
|
142
|
-
flexStyle={{ alignItems: "center", justifyContent: "center" }}
|
|
143
|
-
>
|
|
144
|
-
<Icons icon="WIFI_X" size={20} color={theme.colors.red[900]} />
|
|
145
|
-
<Typography
|
|
146
|
-
text="Imagem indisponível"
|
|
147
|
-
size={theme.fontSizes.sm}
|
|
148
|
-
color={theme.colors.gray[700]}
|
|
149
|
-
/>
|
|
150
|
-
</Box>
|
|
151
|
-
)}
|
|
152
|
-
</Box>
|
|
153
|
-
) : fileType === "video" ? (
|
|
154
|
-
<Box
|
|
155
|
-
height={180}
|
|
156
|
-
borderStyled={{
|
|
157
|
-
borderWidth: 2,
|
|
158
|
-
borderColor: isInternetReachable
|
|
159
|
-
? theme.colors.blue[525]
|
|
160
|
-
: theme.colors.red[900],
|
|
161
|
-
borderRadius: theme.borderWidths.thick_medium,
|
|
162
|
-
}}
|
|
163
|
-
>
|
|
164
|
-
{isInternetReachable ? (
|
|
165
|
-
<VideoView
|
|
166
|
-
player={videoPlayer}
|
|
167
|
-
style={{ width: "100%", height: "100%" }}
|
|
168
|
-
fullscreenOptions={{ enable: true }}
|
|
169
|
-
allowsPictureInPicture
|
|
170
|
-
/>
|
|
171
|
-
) : (
|
|
172
|
-
<Box
|
|
173
|
-
flexStyle={{
|
|
174
|
-
flex: 1,
|
|
175
|
-
alignItems: "center",
|
|
176
|
-
justifyContent: "center",
|
|
177
|
-
}}
|
|
178
|
-
>
|
|
179
|
-
<Icons icon="WIFI_X" size={20} color={theme.colors.red[900]} />
|
|
180
|
-
<Typography
|
|
181
|
-
text="Vídeo indisponível"
|
|
182
|
-
size={theme.fontSizes.sm}
|
|
183
|
-
color={theme.colors.gray[700]}
|
|
184
|
-
/>
|
|
185
|
-
</Box>
|
|
186
|
-
)}
|
|
187
|
-
</Box>
|
|
188
|
-
) : (
|
|
118
|
+
resizeMode="cover"
|
|
119
|
+
/>
|
|
120
|
+
)}
|
|
121
|
+
|
|
122
|
+
{/* PDF / OUTROS */}
|
|
123
|
+
{fileType !== "image" && fileType !== "video" && (
|
|
189
124
|
<Box
|
|
190
125
|
flexStyle={{
|
|
191
126
|
flexDirection: "row",
|
|
@@ -195,27 +130,19 @@ const NotificationDetailCard: React.FC<INotificationDetailCardProps> = forwardRe
|
|
|
195
130
|
paddingStyle={{ padding: theme.paddings.sm }}
|
|
196
131
|
>
|
|
197
132
|
<Typography
|
|
198
|
-
text={
|
|
199
|
-
isInternetReachable
|
|
200
|
-
? `Abrir arquivo (${fileType.toUpperCase()})`
|
|
201
|
-
: "Arquivo indisponível"
|
|
202
|
-
}
|
|
133
|
+
text={`Abrir arquivo (${fileType.toUpperCase()})`}
|
|
203
134
|
fontFamily={theme.fonts.inter_medium_500}
|
|
204
135
|
color={theme.colors.blue[500]}
|
|
205
136
|
size={theme.fontSizes.md}
|
|
206
137
|
/>
|
|
207
|
-
{
|
|
208
|
-
<Icons icon="FILES" size={20} color={theme.colors.blue[500]} />
|
|
209
|
-
) : (
|
|
210
|
-
<Icons icon="WIFI_X" size={20} color={theme.colors.red[900]} />
|
|
211
|
-
)}
|
|
138
|
+
<Icons icon="FILES" size={20} color={theme.colors.blue[500]} />
|
|
212
139
|
</Box>
|
|
213
140
|
)}
|
|
214
141
|
</TouchableOpacity>
|
|
215
142
|
)}
|
|
216
143
|
</Box>
|
|
217
144
|
|
|
218
|
-
{/* MODAL
|
|
145
|
+
{/* MODAL (imagem ou vídeo) */}
|
|
219
146
|
{fileType === "image" && (
|
|
220
147
|
<Modal visible={visible} transparent animationType="fade">
|
|
221
148
|
<View
|
|
@@ -235,11 +162,7 @@ const NotificationDetailCard: React.FC<INotificationDetailCardProps> = forwardRe
|
|
|
235
162
|
|
|
236
163
|
<Image
|
|
237
164
|
source={{ uri: fileUrl }}
|
|
238
|
-
style={{
|
|
239
|
-
width: "90%",
|
|
240
|
-
height: "70%",
|
|
241
|
-
borderRadius: theme.borderWidths.thick_medium,
|
|
242
|
-
}}
|
|
165
|
+
style={{ width: "90%", height: "70%" }}
|
|
243
166
|
resizeMode="contain"
|
|
244
167
|
/>
|
|
245
168
|
</View>
|
|
@@ -252,7 +175,4 @@ const NotificationDetailCard: React.FC<INotificationDetailCardProps> = forwardRe
|
|
|
252
175
|
|
|
253
176
|
NotificationDetailCard.displayName = "NotificationDetailCard";
|
|
254
177
|
|
|
255
|
-
/**
|
|
256
|
-
* EXPORTS
|
|
257
|
-
*/
|
|
258
178
|
export default asBaseComponent(NotificationDetailCard);
|