@jobber/components-native 0.96.0 → 0.97.0
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/dist/package.json +2 -2
- package/dist/src/FormatFile/FormatFile.js +2 -2
- package/dist/src/FormatFile/FormatFileThumbnail.js +2 -2
- package/dist/src/FormatFile/components/MediaView/MediaView.js +5 -2
- package/dist/tsconfig.build.tsbuildinfo +1 -1
- package/dist/types/src/FormatFile/FormatFile.d.ts +7 -1
- package/dist/types/src/FormatFile/FormatFileThumbnail.d.ts +7 -1
- package/dist/types/src/FormatFile/components/MediaView/MediaView.d.ts +2 -1
- package/package.json +2 -2
- package/src/FormatFile/FormatFile.tsx +9 -0
- package/src/FormatFile/FormatFileThumbnail.tsx +9 -0
- package/src/FormatFile/components/MediaView/MediaView.tsx +6 -1
package/dist/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@jobber/components-native",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.97.0",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"description": "React Native implementation of Atlantis",
|
|
6
6
|
"repository": {
|
|
@@ -96,5 +96,5 @@
|
|
|
96
96
|
"react-native-safe-area-context": "^5.4.0",
|
|
97
97
|
"react-native-svg": ">=12.0.0"
|
|
98
98
|
},
|
|
99
|
-
"gitHead": "
|
|
99
|
+
"gitHead": "1c8d10a463f068f8580fa2296bba3a34f9c0a22e"
|
|
100
100
|
}
|
|
@@ -18,9 +18,9 @@ import { AtlantisFormatFileContext } from "./context/FormatFileContext";
|
|
|
18
18
|
import { createUseCreateThumbnail } from "./utils/createUseCreateThumbnail";
|
|
19
19
|
import { parseFile } from "./utils/parseFile";
|
|
20
20
|
import { useAtlantisI18n } from "../hooks/useAtlantisI18n";
|
|
21
|
-
export function FormatFileContent({ accessibilityLabel, file, showOverlay, styleInGrid, onUploadComplete, isMedia, skipContainerStyles = false, }) {
|
|
21
|
+
export function FormatFileContent({ accessibilityLabel, file, showOverlay, styleInGrid, onUploadComplete, isMedia, skipContainerStyles = false, onMediaLoadEnd, }) {
|
|
22
22
|
const styles = useStyles();
|
|
23
|
-
const content = isMedia ? (React.createElement(MediaView, { accessibilityLabel: accessibilityLabel, file: file, showOverlay: showOverlay, showError: file.error, styleInGrid: styleInGrid, onUploadComplete: onUploadComplete })) : (React.createElement(FileView, { accessibilityLabel: accessibilityLabel, file: file, showOverlay: showOverlay, showError: file.error, styleInGrid: styleInGrid, onUploadComplete: onUploadComplete }));
|
|
23
|
+
const content = isMedia ? (React.createElement(MediaView, { accessibilityLabel: accessibilityLabel, file: file, showOverlay: showOverlay, showError: file.error, styleInGrid: styleInGrid, onUploadComplete: onUploadComplete, onLoadEnd: onMediaLoadEnd })) : (React.createElement(FileView, { accessibilityLabel: accessibilityLabel, file: file, showOverlay: showOverlay, showError: file.error, styleInGrid: styleInGrid, onUploadComplete: onUploadComplete }));
|
|
24
24
|
if (skipContainerStyles) {
|
|
25
25
|
return content;
|
|
26
26
|
}
|
|
@@ -26,7 +26,7 @@ import { parseFile } from "./utils/parseFile";
|
|
|
26
26
|
* where you need a single shared BottomSheet rather than one per item, and
|
|
27
27
|
* where the consumer controls the item dimensions via the `size` prop.
|
|
28
28
|
*/
|
|
29
|
-
export function FormatFileThumbnail({ file, accessibilityLabel, showFileTypeIndicator = true, createThumbnail: createThumbnailProp, size, testID, }) {
|
|
29
|
+
export function FormatFileThumbnail({ file, accessibilityLabel, showFileTypeIndicator = true, createThumbnail: createThumbnailProp, size, testID, onMediaLoadEnd, }) {
|
|
30
30
|
const formattedFile = useMemo(() => parseFile(file, showFileTypeIndicator), [file, showFileTypeIndicator]);
|
|
31
31
|
const styles = useStyles();
|
|
32
32
|
const [showOverlay, setShowOverlay] = useState(formattedFile.status !== StatusCode.Completed);
|
|
@@ -42,5 +42,5 @@ export function FormatFileThumbnail({ file, accessibilityLabel, showFileTypeIndi
|
|
|
42
42
|
{ marginBottom: 0 },
|
|
43
43
|
size && { width: size.width, height: size.height },
|
|
44
44
|
], testID: testID },
|
|
45
|
-
React.createElement(FormatFileContent, { accessibilityLabel: accessibilityLabel, file: formattedFile, onUploadComplete: () => setShowOverlay(false), isMedia: !!formattedFile.isMedia, styleInGrid: true, showOverlay: showOverlay, skipContainerStyles: true }))));
|
|
45
|
+
React.createElement(FormatFileContent, { accessibilityLabel: accessibilityLabel, file: formattedFile, onUploadComplete: () => setShowOverlay(false), isMedia: !!formattedFile.isMedia, styleInGrid: true, showOverlay: showOverlay, skipContainerStyles: true, onMediaLoadEnd: onMediaLoadEnd }))));
|
|
46
46
|
}
|
|
@@ -9,7 +9,7 @@ import { ProgressBar } from "../ProgressBar";
|
|
|
9
9
|
import { ErrorIcon } from "../ErrorIcon";
|
|
10
10
|
import { useAtlantisFormatFileContext } from "../../context/FormatFileContext";
|
|
11
11
|
import { useAtlantisI18n } from "../../../hooks/useAtlantisI18n";
|
|
12
|
-
export function MediaView({ accessibilityLabel, showOverlay, showError, file, styleInGrid, onUploadComplete, }) {
|
|
12
|
+
export function MediaView({ accessibilityLabel, showOverlay, showError, file, styleInGrid, onUploadComplete, onLoadEnd, }) {
|
|
13
13
|
const { t } = useAtlantisI18n();
|
|
14
14
|
const { useCreateThumbnail } = useAtlantisFormatFileContext();
|
|
15
15
|
const { thumbnail, error } = useCreateThumbnail(file);
|
|
@@ -44,7 +44,10 @@ export function MediaView({ accessibilityLabel, showOverlay, showError, file, st
|
|
|
44
44
|
React.createElement(ImageBackground, { style: [
|
|
45
45
|
styles.imageBackground,
|
|
46
46
|
styleInGrid ? styles.imageBackgroundGrid : styles.imageBackgroundFlat,
|
|
47
|
-
], resizeMode: styleInGrid ? "cover" : "contain", source: { uri }, testID: "test-image", onLoadStart: handleLoadStart, onLoadEnd:
|
|
47
|
+
], resizeMode: styleInGrid ? "cover" : "contain", source: { uri }, testID: "test-image", onLoadStart: handleLoadStart, onLoadEnd: () => {
|
|
48
|
+
handleLoadEnd();
|
|
49
|
+
onLoadEnd === null || onLoadEnd === void 0 ? void 0 : onLoadEnd();
|
|
50
|
+
} },
|
|
48
51
|
React.createElement(Overlay, { isLoading: isLoading, showOverlay: showOverlay, hasError: hasError, file: file, onUploadComplete: onUploadComplete, styles: styles }))));
|
|
49
52
|
}
|
|
50
53
|
function Overlay({ isLoading, showOverlay, hasError, file, onUploadComplete, styles, }) {
|