jornada-ui 2.0.3 → 2.0.4
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 +35 -64
- package/lib/commonjs/components/notification-details-card/index.js.map +1 -1
- package/lib/module/components/notification-details-card/index.js +35 -64
- 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 +2 -1
- package/src/components/notification-details-card/index.tsx +46 -86
|
@@ -6,7 +6,7 @@ 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
|
|
9
|
+
var _reactNativeVideo = _interopRequireDefault(require("react-native-video"));
|
|
10
10
|
var _index = require("../../common/icons-svg/index.js");
|
|
11
11
|
var _index2 = _interopRequireDefault(require("../box/index.js"));
|
|
12
12
|
var _index3 = _interopRequireDefault(require("../typography/index.js"));
|
|
@@ -32,12 +32,6 @@ const NotificationDetailCard = /*#__PURE__*/(0, _react.forwardRef)(({
|
|
|
32
32
|
testID
|
|
33
33
|
}, ref) => {
|
|
34
34
|
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
35
|
function openFile() {
|
|
42
36
|
if (!isInternetReachable) return;
|
|
43
37
|
if (fileType === "image" || fileType === "video") {
|
|
@@ -95,7 +89,7 @@ const NotificationDetailCard = /*#__PURE__*/(0, _react.forwardRef)(({
|
|
|
95
89
|
lineHeight: _theme.theme.lineHeight.md,
|
|
96
90
|
color: _theme.theme.colors.gray[700],
|
|
97
91
|
marginBottom: fileUrl ? 12 : 0
|
|
98
|
-
}), fileUrl && /*#__PURE__*/(0, _jsxRuntime.
|
|
92
|
+
}), fileUrl && /*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNative.TouchableOpacity, {
|
|
99
93
|
testID: "button",
|
|
100
94
|
onPress: openFile,
|
|
101
95
|
activeOpacity: 0.8,
|
|
@@ -106,55 +100,31 @@ const NotificationDetailCard = /*#__PURE__*/(0, _react.forwardRef)(({
|
|
|
106
100
|
borderWidth: 1,
|
|
107
101
|
borderColor: isInternetReachable ? _theme.theme.colors.gray[300] : _theme.theme.colors.red[900]
|
|
108
102
|
},
|
|
109
|
-
children: fileType === "image"
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
103
|
+
children: [fileType === "image" && /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Image, {
|
|
104
|
+
source: {
|
|
105
|
+
uri: fileUrl
|
|
106
|
+
},
|
|
107
|
+
style: {
|
|
108
|
+
width: "100%",
|
|
109
|
+
height: 180,
|
|
113
110
|
borderRadius: _theme.theme.borderWidths.thick_medium
|
|
114
111
|
},
|
|
115
|
-
|
|
112
|
+
resizeMode: "cover"
|
|
113
|
+
}), fileType === "video" && /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.View, {
|
|
114
|
+
style: {
|
|
115
|
+
height: 180
|
|
116
|
+
},
|
|
117
|
+
children: isInternetReachable ? /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNativeVideo.default, {
|
|
116
118
|
source: {
|
|
117
119
|
uri: fileUrl
|
|
118
120
|
},
|
|
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, {
|
|
126
|
-
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
|
-
borderRadius: _theme.theme.borderWidths.thick_medium
|
|
147
|
-
},
|
|
148
|
-
children: isInternetReachable ? /*#__PURE__*/(0, _jsxRuntime.jsx)(_expoVideo.VideoView, {
|
|
149
|
-
player: videoPlayer,
|
|
150
121
|
style: {
|
|
151
122
|
width: "100%",
|
|
152
123
|
height: "100%"
|
|
153
124
|
},
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
allowsPictureInPicture: true
|
|
125
|
+
controls: true,
|
|
126
|
+
resizeMode: "cover",
|
|
127
|
+
paused: true
|
|
158
128
|
}) : /*#__PURE__*/(0, _jsxRuntime.jsxs)(_index2.default, {
|
|
159
129
|
flexStyle: {
|
|
160
130
|
flex: 1,
|
|
@@ -171,7 +141,7 @@ const NotificationDetailCard = /*#__PURE__*/(0, _react.forwardRef)(({
|
|
|
171
141
|
color: _theme.theme.colors.gray[700]
|
|
172
142
|
})]
|
|
173
143
|
})
|
|
174
|
-
})
|
|
144
|
+
}), fileType !== "image" && fileType !== "video" && /*#__PURE__*/(0, _jsxRuntime.jsxs)(_index2.default, {
|
|
175
145
|
flexStyle: {
|
|
176
146
|
flexDirection: "row",
|
|
177
147
|
alignItems: "center",
|
|
@@ -181,22 +151,18 @@ const NotificationDetailCard = /*#__PURE__*/(0, _react.forwardRef)(({
|
|
|
181
151
|
padding: _theme.theme.paddings.sm
|
|
182
152
|
},
|
|
183
153
|
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_index3.default, {
|
|
184
|
-
text:
|
|
154
|
+
text: `Abrir arquivo (${fileType.toUpperCase()})`,
|
|
185
155
|
fontFamily: _theme.theme.fonts.inter_medium_500,
|
|
186
156
|
color: _theme.theme.colors.blue[500],
|
|
187
157
|
size: _theme.theme.fontSizes.md
|
|
188
|
-
}),
|
|
158
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_index.Icons, {
|
|
189
159
|
icon: "FILES",
|
|
190
160
|
size: 20,
|
|
191
161
|
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
162
|
})]
|
|
197
|
-
})
|
|
163
|
+
})]
|
|
198
164
|
})]
|
|
199
|
-
}), fileType === "image" && /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Modal, {
|
|
165
|
+
}), (fileType === "image" || fileType === "video") && /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Modal, {
|
|
200
166
|
visible: visible,
|
|
201
167
|
transparent: true,
|
|
202
168
|
animationType: "fade",
|
|
@@ -219,15 +185,24 @@ const NotificationDetailCard = /*#__PURE__*/(0, _react.forwardRef)(({
|
|
|
219
185
|
size: 28,
|
|
220
186
|
color: _theme.theme.colors.neutral[25]
|
|
221
187
|
})
|
|
222
|
-
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Image, {
|
|
188
|
+
}), fileType === "image" ? /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Image, {
|
|
223
189
|
source: {
|
|
224
190
|
uri: fileUrl
|
|
225
191
|
},
|
|
226
192
|
style: {
|
|
227
193
|
width: "90%",
|
|
228
|
-
height: "70%"
|
|
229
|
-
|
|
194
|
+
height: "70%"
|
|
195
|
+
},
|
|
196
|
+
resizeMode: "contain"
|
|
197
|
+
}) : /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNativeVideo.default, {
|
|
198
|
+
source: {
|
|
199
|
+
uri: fileUrl
|
|
230
200
|
},
|
|
201
|
+
style: {
|
|
202
|
+
width: "100%",
|
|
203
|
+
height: "60%"
|
|
204
|
+
},
|
|
205
|
+
controls: true,
|
|
231
206
|
resizeMode: "contain"
|
|
232
207
|
})]
|
|
233
208
|
})
|
|
@@ -235,9 +210,5 @@ const NotificationDetailCard = /*#__PURE__*/(0, _react.forwardRef)(({
|
|
|
235
210
|
});
|
|
236
211
|
});
|
|
237
212
|
NotificationDetailCard.displayName = "NotificationDetailCard";
|
|
238
|
-
|
|
239
|
-
/**
|
|
240
|
-
* EXPORTS
|
|
241
|
-
*/
|
|
242
213
|
var _default = exports.default = (0, _asBaseComponent.asBaseComponent)(NotificationDetailCard);
|
|
243
214
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_react","_interopRequireWildcard","require","_reactNative","
|
|
1
|
+
{"version":3,"names":["_react","_interopRequireWildcard","require","_reactNative","_reactNativeVideo","_interopRequireDefault","_index","_index2","_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","View","controls","paused","alignItems","justifyContent","Icons","icon","toUpperCase","inter_medium_500","Modal","transparent","animationType","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,YAAA,GAAAD,OAAA;AACA,IAAAE,iBAAA,GAAAC,sBAAA,CAAAH,OAAA;AAGA,IAAAI,MAAA,GAAAJ,OAAA;AAGA,IAAAK,OAAA,GAAAF,sBAAA,CAAAH,OAAA;AACA,IAAAM,OAAA,GAAAH,sBAAA,CAAAH,OAAA;AAIA,IAAAO,gBAAA,GAAAP,OAAA;AAGA,IAAAQ,MAAA,GAAAR,OAAA;AAAiD,IAAAS,WAAA,GAAAT,OAAA;AAAA,SAAAG,uBAAAO,CAAA,WAAAA,CAAA,IAAAA,CAAA,CAAAC,UAAA,GAAAD,CAAA,KAAAE,OAAA,EAAAF,CAAA;AAAA,SAAAX,wBAAAW,CAAA,EAAAG,CAAA,6BAAAC,OAAA,MAAAC,CAAA,OAAAD,OAAA,IAAAE,CAAA,OAAAF,OAAA,YAAAf,uBAAA,YAAAA,CAAAW,CAAA,EAAAG,CAAA,SAAAA,CAAA,IAAAH,CAAA,IAAAA,CAAA,CAAAC,UAAA,SAAAD,CAAA,MAAAO,CAAA,EAAAC,CAAA,EAAAC,CAAA,KAAAC,S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,sBAAsB,CAACuF,WAAW,GAAG,wBAAwB;AAAC,IAAAC,QAAA,GAAAC,OAAA,CAAA1G,OAAA,GAE/C,IAAA2G,gCAAe,EAAC1F,sBAAsB,CAAC","ignoreList":[]}
|
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
*/
|
|
6
6
|
import React, { forwardRef, useState } from "react";
|
|
7
7
|
import { Modal, TouchableOpacity, Image, View } from "react-native";
|
|
8
|
-
import
|
|
8
|
+
import Video from "react-native-video";
|
|
9
9
|
|
|
10
10
|
// commons / icons
|
|
11
11
|
import { Icons } from "../../common/icons-svg/index.js";
|
|
@@ -34,12 +34,6 @@ const NotificationDetailCard = /*#__PURE__*/forwardRef(({
|
|
|
34
34
|
testID
|
|
35
35
|
}, ref) => {
|
|
36
36
|
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
37
|
function openFile() {
|
|
44
38
|
if (!isInternetReachable) return;
|
|
45
39
|
if (fileType === "image" || fileType === "video") {
|
|
@@ -97,7 +91,7 @@ const NotificationDetailCard = /*#__PURE__*/forwardRef(({
|
|
|
97
91
|
lineHeight: theme.lineHeight.md,
|
|
98
92
|
color: theme.colors.gray[700],
|
|
99
93
|
marginBottom: fileUrl ? 12 : 0
|
|
100
|
-
}), fileUrl && /*#__PURE__*/
|
|
94
|
+
}), fileUrl && /*#__PURE__*/_jsxs(TouchableOpacity, {
|
|
101
95
|
testID: "button",
|
|
102
96
|
onPress: openFile,
|
|
103
97
|
activeOpacity: 0.8,
|
|
@@ -108,55 +102,31 @@ const NotificationDetailCard = /*#__PURE__*/forwardRef(({
|
|
|
108
102
|
borderWidth: 1,
|
|
109
103
|
borderColor: isInternetReachable ? theme.colors.gray[300] : theme.colors.red[900]
|
|
110
104
|
},
|
|
111
|
-
children: fileType === "image"
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
105
|
+
children: [fileType === "image" && /*#__PURE__*/_jsx(Image, {
|
|
106
|
+
source: {
|
|
107
|
+
uri: fileUrl
|
|
108
|
+
},
|
|
109
|
+
style: {
|
|
110
|
+
width: "100%",
|
|
111
|
+
height: 180,
|
|
115
112
|
borderRadius: theme.borderWidths.thick_medium
|
|
116
113
|
},
|
|
117
|
-
|
|
114
|
+
resizeMode: "cover"
|
|
115
|
+
}), fileType === "video" && /*#__PURE__*/_jsx(View, {
|
|
116
|
+
style: {
|
|
117
|
+
height: 180
|
|
118
|
+
},
|
|
119
|
+
children: isInternetReachable ? /*#__PURE__*/_jsx(Video, {
|
|
118
120
|
source: {
|
|
119
121
|
uri: fileUrl
|
|
120
122
|
},
|
|
121
|
-
style: {
|
|
122
|
-
width: "100%",
|
|
123
|
-
height: 180,
|
|
124
|
-
borderRadius: theme.borderWidths.thick_medium
|
|
125
|
-
},
|
|
126
|
-
resizeMode: "cover"
|
|
127
|
-
}) : /*#__PURE__*/_jsxs(Box, {
|
|
128
|
-
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
|
-
borderRadius: theme.borderWidths.thick_medium
|
|
149
|
-
},
|
|
150
|
-
children: isInternetReachable ? /*#__PURE__*/_jsx(VideoView, {
|
|
151
|
-
player: videoPlayer,
|
|
152
123
|
style: {
|
|
153
124
|
width: "100%",
|
|
154
125
|
height: "100%"
|
|
155
126
|
},
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
allowsPictureInPicture: true
|
|
127
|
+
controls: true,
|
|
128
|
+
resizeMode: "cover",
|
|
129
|
+
paused: true
|
|
160
130
|
}) : /*#__PURE__*/_jsxs(Box, {
|
|
161
131
|
flexStyle: {
|
|
162
132
|
flex: 1,
|
|
@@ -173,7 +143,7 @@ const NotificationDetailCard = /*#__PURE__*/forwardRef(({
|
|
|
173
143
|
color: theme.colors.gray[700]
|
|
174
144
|
})]
|
|
175
145
|
})
|
|
176
|
-
})
|
|
146
|
+
}), fileType !== "image" && fileType !== "video" && /*#__PURE__*/_jsxs(Box, {
|
|
177
147
|
flexStyle: {
|
|
178
148
|
flexDirection: "row",
|
|
179
149
|
alignItems: "center",
|
|
@@ -183,22 +153,18 @@ const NotificationDetailCard = /*#__PURE__*/forwardRef(({
|
|
|
183
153
|
padding: theme.paddings.sm
|
|
184
154
|
},
|
|
185
155
|
children: [/*#__PURE__*/_jsx(Typography, {
|
|
186
|
-
text:
|
|
156
|
+
text: `Abrir arquivo (${fileType.toUpperCase()})`,
|
|
187
157
|
fontFamily: theme.fonts.inter_medium_500,
|
|
188
158
|
color: theme.colors.blue[500],
|
|
189
159
|
size: theme.fontSizes.md
|
|
190
|
-
}),
|
|
160
|
+
}), /*#__PURE__*/_jsx(Icons, {
|
|
191
161
|
icon: "FILES",
|
|
192
162
|
size: 20,
|
|
193
163
|
color: theme.colors.blue[500]
|
|
194
|
-
}) : /*#__PURE__*/_jsx(Icons, {
|
|
195
|
-
icon: "WIFI_X",
|
|
196
|
-
size: 20,
|
|
197
|
-
color: theme.colors.red[900]
|
|
198
164
|
})]
|
|
199
|
-
})
|
|
165
|
+
})]
|
|
200
166
|
})]
|
|
201
|
-
}), fileType === "image" && /*#__PURE__*/_jsx(Modal, {
|
|
167
|
+
}), (fileType === "image" || fileType === "video") && /*#__PURE__*/_jsx(Modal, {
|
|
202
168
|
visible: visible,
|
|
203
169
|
transparent: true,
|
|
204
170
|
animationType: "fade",
|
|
@@ -221,15 +187,24 @@ const NotificationDetailCard = /*#__PURE__*/forwardRef(({
|
|
|
221
187
|
size: 28,
|
|
222
188
|
color: theme.colors.neutral[25]
|
|
223
189
|
})
|
|
224
|
-
}), /*#__PURE__*/_jsx(Image, {
|
|
190
|
+
}), fileType === "image" ? /*#__PURE__*/_jsx(Image, {
|
|
225
191
|
source: {
|
|
226
192
|
uri: fileUrl
|
|
227
193
|
},
|
|
228
194
|
style: {
|
|
229
195
|
width: "90%",
|
|
230
|
-
height: "70%"
|
|
231
|
-
|
|
196
|
+
height: "70%"
|
|
197
|
+
},
|
|
198
|
+
resizeMode: "contain"
|
|
199
|
+
}) : /*#__PURE__*/_jsx(Video, {
|
|
200
|
+
source: {
|
|
201
|
+
uri: fileUrl
|
|
232
202
|
},
|
|
203
|
+
style: {
|
|
204
|
+
width: "100%",
|
|
205
|
+
height: "60%"
|
|
206
|
+
},
|
|
207
|
+
controls: true,
|
|
233
208
|
resizeMode: "contain"
|
|
234
209
|
})]
|
|
235
210
|
})
|
|
@@ -237,9 +212,5 @@ const NotificationDetailCard = /*#__PURE__*/forwardRef(({
|
|
|
237
212
|
});
|
|
238
213
|
});
|
|
239
214
|
NotificationDetailCard.displayName = "NotificationDetailCard";
|
|
240
|
-
|
|
241
|
-
/**
|
|
242
|
-
* EXPORTS
|
|
243
|
-
*/
|
|
244
215
|
export default asBaseComponent(NotificationDetailCard);
|
|
245
216
|
//# 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","Video","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","controls","paused","alignItems","justifyContent","icon","toUpperCase","inter_medium_500","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;AACnE,OAAOC,KAAK,MAAM,oBAAoB;;AAEtC;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,gBAAGhB,UAAU,CAI/E,CACE;EAAEiB,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,GAAG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G,CAAE;UAAA1C,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,EAElBpB,QAAQ,KAAK,OAAO,gBACnBR,IAAA,CAACT,KAAK;UACJuE,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,gBAEFjE,IAAA,CAACP,KAAK;UACJqE,MAAM,EAAE;YAAEC,GAAG,EAAExD;UAAQ,CAAE;UACzBoD,KAAK,EAAE;YAAEvB,KAAK,EAAE,MAAM;YAAE4B,MAAM,EAAE;UAAM,CAAE;UACxCE,QAAQ;UACRD,UAAU,EAAC;QAAS,CACrB,CACF;MAAA,CACG;IAAC,CACF,CACR;EAAA,CACE,CAAC;AAEV,CACF,CAAC;AAED9D,sBAAsB,CAAC2E,WAAW,GAAG,wBAAwB;AAE7D,eAAejF,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;AAYpD,OAAO,KAAK,EAAE,4BAA4B,EAAE,MAAM,aAAa,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;AAYpD,OAAO,KAAK,EAAE,4BAA4B,EAAE,MAAM,aAAa,CAAC;;AA0MhE,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;AAYpD,OAAO,KAAK,EAAE,4BAA4B,EAAE,MAAM,aAAa,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;AAYpD,OAAO,KAAK,EAAE,4BAA4B,EAAE,MAAM,aAAa,CAAC;;AA0MhE,wBAAuD"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "jornada-ui",
|
|
3
|
-
"version": "2.0.
|
|
3
|
+
"version": "2.0.4",
|
|
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",
|
|
@@ -82,6 +82,7 @@
|
|
|
82
82
|
"@storybook/test": "^8.3.0",
|
|
83
83
|
"expo-video": "~3.0.15",
|
|
84
84
|
"react-native-svg": "^15.11.2",
|
|
85
|
+
"react-native-video": "6.18.0",
|
|
85
86
|
"react-native-web": "^0.19.12"
|
|
86
87
|
},
|
|
87
88
|
"devDependencies": {
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
*/
|
|
4
4
|
import React, { forwardRef, useState } from "react";
|
|
5
5
|
import { Modal, TouchableOpacity, Image, View } from "react-native";
|
|
6
|
-
import
|
|
6
|
+
import Video from "react-native-video";
|
|
7
7
|
|
|
8
8
|
// commons / icons
|
|
9
9
|
import { Icons } from "../../common/icons-svg";
|
|
@@ -32,15 +32,6 @@ const NotificationDetailCard: React.FC<INotificationDetailCardProps> = forwardRe
|
|
|
32
32
|
) => {
|
|
33
33
|
const [visible, setVisible] = useState(false);
|
|
34
34
|
|
|
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
35
|
function openFile() {
|
|
45
36
|
if (!isInternetReachable) return;
|
|
46
37
|
|
|
@@ -71,7 +62,7 @@ const NotificationDetailCard: React.FC<INotificationDetailCardProps> = forwardRe
|
|
|
71
62
|
marginStyle={{ marginBottom: 16 }}
|
|
72
63
|
backgroundColor={theme.colors.neutral[25]}
|
|
73
64
|
>
|
|
74
|
-
{/*
|
|
65
|
+
{/* Borda lateral */}
|
|
75
66
|
<Box
|
|
76
67
|
width={8}
|
|
77
68
|
backgroundColor={borderColor}
|
|
@@ -83,7 +74,7 @@ const NotificationDetailCard: React.FC<INotificationDetailCardProps> = forwardRe
|
|
|
83
74
|
|
|
84
75
|
{/* Conteúdo */}
|
|
85
76
|
<Box flexStyle={{ flex: 1 }} paddingStyle={{ padding: theme.paddings.md }}>
|
|
86
|
-
{/*
|
|
77
|
+
{/* Título */}
|
|
87
78
|
<Typography
|
|
88
79
|
text={title}
|
|
89
80
|
fontFamily={theme.fonts.inter_bold}
|
|
@@ -93,7 +84,7 @@ const NotificationDetailCard: React.FC<INotificationDetailCardProps> = forwardRe
|
|
|
93
84
|
marginBottom={8}
|
|
94
85
|
/>
|
|
95
86
|
|
|
96
|
-
{/*
|
|
87
|
+
{/* Descrição */}
|
|
97
88
|
<Typography
|
|
98
89
|
text={description}
|
|
99
90
|
size={theme.fontSizes.sm}
|
|
@@ -102,7 +93,7 @@ const NotificationDetailCard: React.FC<INotificationDetailCardProps> = forwardRe
|
|
|
102
93
|
marginBottom={fileUrl ? 12 : 0}
|
|
103
94
|
/>
|
|
104
95
|
|
|
105
|
-
{/*
|
|
96
|
+
{/* Arquivo */}
|
|
106
97
|
{fileUrl && (
|
|
107
98
|
<TouchableOpacity
|
|
108
99
|
testID="button"
|
|
@@ -116,57 +107,29 @@ const NotificationDetailCard: React.FC<INotificationDetailCardProps> = forwardRe
|
|
|
116
107
|
borderColor: isInternetReachable ? theme.colors.gray[300] : theme.colors.red[900],
|
|
117
108
|
}}
|
|
118
109
|
>
|
|
119
|
-
{
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
110
|
+
{/* IMAGEM */}
|
|
111
|
+
{fileType === "image" && (
|
|
112
|
+
<Image
|
|
113
|
+
source={{ uri: fileUrl }}
|
|
114
|
+
style={{
|
|
115
|
+
width: "100%",
|
|
116
|
+
height: 180,
|
|
126
117
|
borderRadius: theme.borderWidths.thick_medium,
|
|
127
118
|
}}
|
|
128
|
-
|
|
119
|
+
resizeMode="cover"
|
|
120
|
+
/>
|
|
121
|
+
)}
|
|
122
|
+
|
|
123
|
+
{/* VÍDEO */}
|
|
124
|
+
{fileType === "video" && (
|
|
125
|
+
<View style={{ height: 180 }}>
|
|
129
126
|
{isInternetReachable ? (
|
|
130
|
-
<
|
|
127
|
+
<Video
|
|
131
128
|
source={{ uri: fileUrl }}
|
|
132
|
-
style={{
|
|
133
|
-
width: "100%",
|
|
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
129
|
style={{ width: "100%", height: "100%" }}
|
|
168
|
-
|
|
169
|
-
|
|
130
|
+
controls
|
|
131
|
+
resizeMode="cover"
|
|
132
|
+
paused
|
|
170
133
|
/>
|
|
171
134
|
) : (
|
|
172
135
|
<Box
|
|
@@ -184,8 +147,11 @@ const NotificationDetailCard: React.FC<INotificationDetailCardProps> = forwardRe
|
|
|
184
147
|
/>
|
|
185
148
|
</Box>
|
|
186
149
|
)}
|
|
187
|
-
</
|
|
188
|
-
)
|
|
150
|
+
</View>
|
|
151
|
+
)}
|
|
152
|
+
|
|
153
|
+
{/* PDF / OUTROS */}
|
|
154
|
+
{fileType !== "image" && fileType !== "video" && (
|
|
189
155
|
<Box
|
|
190
156
|
flexStyle={{
|
|
191
157
|
flexDirection: "row",
|
|
@@ -195,28 +161,20 @@ const NotificationDetailCard: React.FC<INotificationDetailCardProps> = forwardRe
|
|
|
195
161
|
paddingStyle={{ padding: theme.paddings.sm }}
|
|
196
162
|
>
|
|
197
163
|
<Typography
|
|
198
|
-
text={
|
|
199
|
-
isInternetReachable
|
|
200
|
-
? `Abrir arquivo (${fileType.toUpperCase()})`
|
|
201
|
-
: "Arquivo indisponível"
|
|
202
|
-
}
|
|
164
|
+
text={`Abrir arquivo (${fileType.toUpperCase()})`}
|
|
203
165
|
fontFamily={theme.fonts.inter_medium_500}
|
|
204
166
|
color={theme.colors.blue[500]}
|
|
205
167
|
size={theme.fontSizes.md}
|
|
206
168
|
/>
|
|
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
|
-
)}
|
|
169
|
+
<Icons icon="FILES" size={20} color={theme.colors.blue[500]} />
|
|
212
170
|
</Box>
|
|
213
171
|
)}
|
|
214
172
|
</TouchableOpacity>
|
|
215
173
|
)}
|
|
216
174
|
</Box>
|
|
217
175
|
|
|
218
|
-
{/* MODAL
|
|
219
|
-
{fileType === "image" && (
|
|
176
|
+
{/* MODAL (imagem ou vídeo) */}
|
|
177
|
+
{(fileType === "image" || fileType === "video") && (
|
|
220
178
|
<Modal visible={visible} transparent animationType="fade">
|
|
221
179
|
<View
|
|
222
180
|
style={{
|
|
@@ -233,15 +191,20 @@ const NotificationDetailCard: React.FC<INotificationDetailCardProps> = forwardRe
|
|
|
233
191
|
<Icons icon="CLOSED" size={28} color={theme.colors.neutral[25]} />
|
|
234
192
|
</TouchableOpacity>
|
|
235
193
|
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
width: "90%",
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
194
|
+
{fileType === "image" ? (
|
|
195
|
+
<Image
|
|
196
|
+
source={{ uri: fileUrl }}
|
|
197
|
+
style={{ width: "90%", height: "70%" }}
|
|
198
|
+
resizeMode="contain"
|
|
199
|
+
/>
|
|
200
|
+
) : (
|
|
201
|
+
<Video
|
|
202
|
+
source={{ uri: fileUrl }}
|
|
203
|
+
style={{ width: "100%", height: "60%" }}
|
|
204
|
+
controls
|
|
205
|
+
resizeMode="contain"
|
|
206
|
+
/>
|
|
207
|
+
)}
|
|
245
208
|
</View>
|
|
246
209
|
</Modal>
|
|
247
210
|
)}
|
|
@@ -252,7 +215,4 @@ const NotificationDetailCard: React.FC<INotificationDetailCardProps> = forwardRe
|
|
|
252
215
|
|
|
253
216
|
NotificationDetailCard.displayName = "NotificationDetailCard";
|
|
254
217
|
|
|
255
|
-
/**
|
|
256
|
-
* EXPORTS
|
|
257
|
-
*/
|
|
258
218
|
export default asBaseComponent(NotificationDetailCard);
|