TP-51868 | Customer Photo Screenshot Allowed (#676)
This commit is contained in:
@@ -172,7 +172,8 @@ const CustomerProfile: React.FC<ICustomerProfile> = (props) => {
|
||||
};
|
||||
|
||||
const handleExpandImage = () => {
|
||||
getCachedImageBase64(caseDetail.id);
|
||||
// Passing false since this is not a customer doc
|
||||
getCachedImageBase64(caseDetail.id, false);
|
||||
};
|
||||
|
||||
return (
|
||||
|
||||
@@ -1,14 +1,17 @@
|
||||
import React from 'react';
|
||||
import React, { useEffect } from 'react';
|
||||
import { View } from 'react-native';
|
||||
import { GenericStyles } from '../../../RN-UI-LIB/src/styles';
|
||||
import { goBack } from '../../components/utlis/navigationUtlis';
|
||||
import ExpandableImage from '../../components/expandableImage/ExpandableImage';
|
||||
import ScreenshotBlocker from '@components/utlis/ScreenshotBlocker';
|
||||
import { useIsFocused } from '@react-navigation/native';
|
||||
|
||||
interface ImageViewer {
|
||||
route: {
|
||||
params: {
|
||||
imageUrl: string;
|
||||
headerTitle: string;
|
||||
isCustomerDoc: boolean;
|
||||
};
|
||||
};
|
||||
}
|
||||
@@ -16,10 +19,18 @@ interface ImageViewer {
|
||||
const ImageViewer: React.FC<ImageViewer> = (props) => {
|
||||
const {
|
||||
route: {
|
||||
params: { imageUrl, headerTitle },
|
||||
params: { imageUrl, headerTitle, isCustomerDoc },
|
||||
},
|
||||
} = props;
|
||||
|
||||
const isFocused = useIsFocused();
|
||||
|
||||
useEffect(() => {
|
||||
if (isFocused && !isCustomerDoc) {
|
||||
ScreenshotBlocker.unblockScreenshots();
|
||||
}
|
||||
}, [isFocused]);
|
||||
|
||||
return (
|
||||
<View style={GenericStyles.fill}>
|
||||
<ExpandableImage
|
||||
|
||||
@@ -91,7 +91,7 @@ export const getDocumentDetails = async (document: IDocument) => {
|
||||
return null;
|
||||
};
|
||||
|
||||
export const getCachedImageBase64 = (cacheKey: string) => {
|
||||
export const getCachedImageBase64 = (cacheKey: string, isCustomerDoc = true) => {
|
||||
const cacheDirectory = RNFS.CachesDirectoryPath;
|
||||
const cacheFilePath = `${cacheDirectory}/${cacheKey}.jpg`;
|
||||
|
||||
@@ -99,6 +99,7 @@ export const getCachedImageBase64 = (cacheKey: string) => {
|
||||
navigateToScreen('imageFull', {
|
||||
imageUrl: `data:image/png;base64,${data}`,
|
||||
headerTitle: 'Image Viewer',
|
||||
isCustomerDoc,
|
||||
});
|
||||
});
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user