diff --git a/blue_modules/Privacy.android.js b/blue_modules/Privacy.android.js deleted file mode 100644 index 50a8c037c..000000000 --- a/blue_modules/Privacy.android.js +++ /dev/null @@ -1,21 +0,0 @@ -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; diff --git a/blue_modules/Privacy.android.tsx b/blue_modules/Privacy.android.tsx new file mode 100644 index 000000000..07c54680d --- /dev/null +++ b/blue_modules/Privacy.android.tsx @@ -0,0 +1,29 @@ +import { useContext, useEffect } from 'react'; +// @ts-ignore: react-native-obscure is not in the type definition +import Obscure from 'react-native-obscure'; +import { BlueStorageContext } from './storage-context'; +interface PrivacyComponent extends React.FC { + enableBlur: (isPrivacyBlurEnabled: boolean) => void; + disableBlur: () => void; +} + +const Privacy: PrivacyComponent = () => { + const { isPrivacyBlurEnabled } = useContext(BlueStorageContext); + + useEffect(() => { + Obscure.deactivateObscure(); + }, [isPrivacyBlurEnabled]); + + return null; +}; + +Privacy.enableBlur = (isPrivacyBlurEnabled: boolean) => { + if (!isPrivacyBlurEnabled) return; + Obscure.activateObscure(); +}; + +Privacy.disableBlur = () => { + Obscure.deactivateObscure(); +}; + +export default Privacy; diff --git a/blue_modules/Privacy.ios.js b/blue_modules/Privacy.ios.js deleted file mode 100644 index 5f8c1a1ce..000000000 --- a/blue_modules/Privacy.ios.js +++ /dev/null @@ -1,22 +0,0 @@ -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; diff --git a/blue_modules/Privacy.ios.tsx b/blue_modules/Privacy.ios.tsx new file mode 100644 index 000000000..877a3131b --- /dev/null +++ b/blue_modules/Privacy.ios.tsx @@ -0,0 +1,30 @@ +import { useContext, useEffect } from 'react'; +// @ts-ignore: react-native-obscure is not in the type definition +import { enabled } from 'react-native-privacy-snapshot'; +import { BlueStorageContext } from './storage-context'; + +interface PrivacyComponent extends React.FC { + enableBlur: (isPrivacyBlurEnabled: boolean) => void; + disableBlur: () => void; +} + +const Privacy: PrivacyComponent = () => { + const { isPrivacyBlurEnabled } = useContext(BlueStorageContext); + + useEffect(() => { + Privacy.disableBlur(); + }, [isPrivacyBlurEnabled]); + + return null; +}; + +Privacy.enableBlur = (isPrivacyBlurEnabled: boolean) => { + if (!isPrivacyBlurEnabled) return; + enabled(true); +}; + +Privacy.disableBlur = () => { + enabled(false); +}; + +export default Privacy; diff --git a/blue_modules/Privacy.js b/blue_modules/Privacy.js deleted file mode 100644 index 8ca779e51..000000000 --- a/blue_modules/Privacy.js +++ /dev/null @@ -1,5 +0,0 @@ -export default class Privacy { - static enableBlur() {} - - static disableBlur() {} -} diff --git a/blue_modules/Privacy.tsx b/blue_modules/Privacy.tsx new file mode 100644 index 000000000..8feff4324 --- /dev/null +++ b/blue_modules/Privacy.tsx @@ -0,0 +1,21 @@ +import React from 'react'; + +interface PrivacyComponent extends React.FC { + enableBlur: () => void; + disableBlur: () => void; +} + +const Privacy: PrivacyComponent = () => { + // Define Privacy's behavior + return null; +}; + +Privacy.enableBlur = () => { + // Define the enableBlur behavior +}; + +Privacy.disableBlur = () => { + // Define the disableBlur behavior +}; + +export default Privacy;