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

22 lines
536 B
JavaScript

import { useContext, useEffect } from 'react';
import Obscure from 'react-native-obscure';
import { BlueStorageContext } from './storage-context';
const Privacy = () => {
const { isPrivacyBlurEnabled } = useContext(BlueStorageContext);
useEffect(() => {
Privacy.disableBlur();
}, [isPrivacyBlurEnabled]);
Privacy.enableBlur = () => {
if (!isPrivacyBlurEnabled) return;
Obscure.activateObscure();
};
Privacy.disableBlur = () => {
Obscure.deactivateObscure();
};
return null;
};
export default Privacy;