mirror of
https://github.com/BlueWallet/BlueWallet.git
synced 2024-11-19 09:50:15 +01:00
22 lines
536 B
JavaScript
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;
|