BlueWallet/blue_modules/Privacy.ios.js
Marcos Rodriguez Vélez 0dd75da849 OPS: Toggle Blur
2021-09-25 11:04:45 -04:00

23 lines
525 B
JavaScript

import { useContext, useEffect } from 'react';
import { enabled } from 'react-native-privacy-snapshot';
import { BlueStorageContext } from './storage-context';
const Privacy = () => {
const { isPrivacyBlurEnabled } = useContext(BlueStorageContext);
useEffect(() => {
Privacy.disableBlur();
}, [isPrivacyBlurEnabled]);
Privacy.enableBlur = () => {
if (!isPrivacyBlurEnabled) return;
enabled(true);
};
Privacy.disableBlur = () => {
enabled(false);
};
return null;
};
export default Privacy;