DEL: Remove isCatalyst package

This commit is contained in:
marcosrdz 2021-05-29 01:57:40 -04:00
parent 949b45fefb
commit 646c5a8ea0
16 changed files with 42 additions and 50 deletions

View File

@ -80,7 +80,7 @@ import LnurlPay from './screen/lnd/lnurlPay';
import LnurlPaySuccess from './screen/lnd/lnurlPaySuccess';
import UnlockWith from './UnlockWith';
import DrawerList from './screen/wallets/drawerList';
import { isCatalyst, isTablet } from './blue_modules/environment';
import { isDesktop, isTablet } from './blue_modules/environment';
import SettingsPrivacy from './screen/settings/SettingsPrivacy';
import LNDViewAdditionalInvoicePreImage from './screen/lnd/lndViewAdditionalInvoicePreImage';
@ -349,7 +349,7 @@ const Drawer = createDrawerNavigator();
function DrawerRoot() {
const dimensions = useWindowDimensions();
const isLargeScreen =
Platform.OS === 'android' ? isTablet() : dimensions.width >= Dimensions.get('screen').width / 2 && (isTablet() || isCatalyst);
Platform.OS === 'android' ? isTablet() : dimensions.width >= Dimensions.get('screen').width / 2 && (isTablet() || isDesktop);
const drawerStyle = { width: '0%' };
return (

View File

@ -1,8 +1,7 @@
import { getSystemName, isTablet } from 'react-native-device-info';
import isCatalyst from 'react-native-is-catalyst';
import { getSystemName, isTablet, getDeviceType } from 'react-native-device-info';
const isMacCatalina = getSystemName() === 'Mac OS X';
module.exports.isMacCatalina = isMacCatalina;
module.exports.isCatalyst = isCatalyst;
module.exports.isDesktop = getDeviceType() === 'Desktop';
module.exports.isTablet = isTablet;

View File

@ -4,9 +4,9 @@ import RNFS from 'react-native-fs';
import Share from 'react-native-share';
import loc from '../loc';
import DocumentPicker from 'react-native-document-picker';
import isCatalyst from 'react-native-is-catalyst';
import { launchCamera, launchImageLibrary } from 'react-native-image-picker';
import { presentCameraNotAuthorizedAlert } from '../class/camera';
import { isDesktop } from '../blue_modules/environment';
import ActionSheet from '../screen/ActionSheet';
import BlueClipboard from './clipboard';
const LocalQRCode = require('@remobile/react-native-qrcode-local-image');
@ -17,7 +17,7 @@ const writeFileAndExport = async function (filename, contents) {
await RNFS.writeFile(filePath, contents);
Share.open({
url: 'file://' + filePath,
saveToFiles: isCatalyst,
saveToFiles: isDesktop,
})
.catch(error => {
console.log(error);

View File

@ -276,8 +276,6 @@ PODS:
- React-Core
- react-native-image-picker (3.5.0):
- React-Core
- react-native-is-catalyst (1.0.0):
- React
- react-native-randombytes (3.6.1):
- React-Core
- react-native-safe-area-context (3.2.0):
@ -287,7 +285,7 @@ PODS:
- React
- react-native-tor (0.1.7):
- React
- react-native-webview (11.4.2):
- react-native-webview (11.4.3):
- React-Core
- react-native-widget-center (0.0.4):
- React
@ -366,7 +364,7 @@ PODS:
- React-Core
- RNDefaultPreference (1.4.3):
- React
- RNDeviceInfo (8.1.2):
- RNDeviceInfo (8.1.3):
- React-Core
- RNFS (2.17.0):
- React
@ -376,14 +374,16 @@ PODS:
- React
- RNInAppBrowser (3.5.1):
- React-Core
- RNKeychain (7.0.0):
- React-Core
- RNLocalize (2.0.3):
- React-Core
- RNPrivacySnapshot (1.0.0):
- React
- RNQuickAction (0.3.13):
- React
- RNRate (1.2.4):
- React
- RNRate (1.2.6):
- React-Core
- RNReactNativeHapticFeedback (1.11.0):
- React-Core
- RNReanimated (2.1.0):
@ -422,7 +422,7 @@ PODS:
- RNSentry (2.5.0-beta.1):
- React-Core
- Sentry (= 7.0.0)
- RNShare (6.0.0):
- RNShare (6.0.1):
- React-Core
- RNSVG (12.1.1):
- React
@ -488,7 +488,6 @@ DEPENDENCIES:
- react-native-fingerprint-scanner (from `../node_modules/react-native-fingerprint-scanner`)
- react-native-idle-timer (from `../node_modules/react-native-idle-timer`)
- react-native-image-picker (from `../node_modules/react-native-image-picker`)
- react-native-is-catalyst (from `../node_modules/react-native-is-catalyst`)
- react-native-randombytes (from `../node_modules/react-native-randombytes`)
- react-native-safe-area-context (from `../node_modules/react-native-safe-area-context`)
- react-native-tcp-socket (from `../node_modules/react-native-tcp-socket`)
@ -517,6 +516,7 @@ DEPENDENCIES:
- RNGestureHandler (from `../node_modules/react-native-gesture-handler`)
- RNHandoff (from `../node_modules/react-native-handoff`)
- RNInAppBrowser (from `../node_modules/react-native-inappbrowser-reborn`)
- RNKeychain (from `../node_modules/react-native-keychain`)
- RNLocalize (from `../node_modules/react-native-localize`)
- RNPrivacySnapshot (from `../node_modules/react-native-privacy-snapshot`)
- RNQuickAction (from `../node_modules/react-native-quick-actions`)
@ -604,8 +604,6 @@ EXTERNAL SOURCES:
:path: "../node_modules/react-native-idle-timer"
react-native-image-picker:
:path: "../node_modules/react-native-image-picker"
react-native-is-catalyst:
:path: "../node_modules/react-native-is-catalyst"
react-native-randombytes:
:path: "../node_modules/react-native-randombytes"
react-native-safe-area-context:
@ -662,6 +660,8 @@ EXTERNAL SOURCES:
:path: "../node_modules/react-native-handoff"
RNInAppBrowser:
:path: "../node_modules/react-native-inappbrowser-reborn"
RNKeychain:
:path: "../node_modules/react-native-keychain"
RNLocalize:
:path: "../node_modules/react-native-localize"
RNPrivacySnapshot:
@ -740,12 +740,11 @@ SPEC CHECKSUMS:
react-native-fingerprint-scanner: c68136ca57e3704d7bdf5faa554ea535ce15b1d0
react-native-idle-timer: 97b8283237d45146a7a5c25bdebe9e1e85f3687b
react-native-image-picker: 189e8d3653b00442cb790bce09a283edaf8e02b6
react-native-is-catalyst: 52ee70e0123c82419dd4ce47dc4cc94b22467512
react-native-randombytes: 5fc412efe7b5c55b9002c0004d75fe5fabcaa507
react-native-safe-area-context: e471852c5ed67eea4b10c5d9d43c1cebae3b231d
react-native-tcp-socket: 96a4f104cdcc9c6621aafe92937f163d88447c5b
react-native-tor: 4f389f5719dad633542b57ea32744e954730e7ef
react-native-webview: 90ccc4add19f940dfe6c89d30659aed8134f234d
react-native-webview: 5d05c17ff4a2075735d72c54acb5317c1737a0f5
react-native-widget-center: 0f81d17beb163e7fb5848b06754d7d277fe7d99a
React-RCTActionSheet: 89a0ca9f4a06c1f93c26067af074ccdce0f40336
React-RCTAnimation: 1bde3ecc0c104c55df246eda516e0deb03c4e49b
@ -764,21 +763,22 @@ SPEC CHECKSUMS:
RNCMaskedView: f127cd9652acfa31b91dcff613e07ba18b774db6
RNCPushNotificationIOS: 5b1cf9ad2aaa107ecb92d5d2d7005ba521b2b97a
RNDefaultPreference: 21816c0a6f61a2829ccc0cef034392e9b509ee5f
RNDeviceInfo: 4f480456c7ac8c9919448375399c1a6f14479549
RNDeviceInfo: 49f6d50f861c7810fac2dd9b71cfb56cc1940e14
RNFS: 93d5b5535eb39d98e6b19009faa8fe717f7ea45d
RNGestureHandler: a479ebd5ed4221a810967000735517df0d2db211
RNHandoff: d3b0754cca3a6bcd9b25f544f733f7f033ccf5fa
RNInAppBrowser: 3733c1aa6699983a1c9b4963e85d5e5a48ad297e
RNKeychain: f75b8c8b2f17d3b2aa1f25b4a0ac5b83d947ff8f
RNLocalize: 29e84ea169d3bca6c3b83584536c7f586a07fb98
RNPrivacySnapshot: 71919dde3c6a29dd332115409c2aec564afee8f4
RNQuickAction: 6d404a869dc872cde841ad3147416a670d13fa93
RNRate: 2b31dad120cd1b78e33c6034808561c386a3dddf
RNRate: e0af7e724e5fcf89578dbd22ab6395c85402ef29
RNReactNativeHapticFeedback: 653a8c126a0f5e88ce15ffe280b3ff37e1fbb285
RNReanimated: 70f662b5232dd5d19ccff581e919a54ea73df51c
RNScreens: f7ad633b2e0190b77b6a7aab7f914fad6f198d8d
RNSecureKeyStore: f1ad870e53806453039f650720d2845c678d89c8
RNSentry: 1868bcfe8c69b2c3b2451439a38b3ebea0a7510f
RNShare: 31fa0cedbd06c2744a78e0d2b7ba364778aa3506
RNShare: 755de6bac084428f8fd8fb54c376f126f40e560c
RNSVG: 551acb6562324b1d52a4e0758f7ca0ec234e278f
RNVectorIcons: bc69e6a278b14842063605de32bec61f0b251a59
RNWatch: e4c5d19506c94506860032fb68aedd5991beb985

4
package-lock.json generated
View File

@ -17687,10 +17687,6 @@
"resolved": "https://registry.npmjs.org/react-native-iphone-x-helper/-/react-native-iphone-x-helper-1.3.1.tgz",
"integrity": "sha512-HOf0jzRnq2/aFUcdCJ9w9JGzN3gdEg0zFE4FyYlp4jtidqU03D5X7ZegGKfT1EWteR0gPBGp9ye5T5FvSWi9Yg=="
},
"react-native-is-catalyst": {
"version": "git+https://github.com/BlueWallet/react-native-is-catalyst.git#a665155424ae5b865971f71ba2625b2c53983364",
"from": "git+https://github.com/BlueWallet/react-native-is-catalyst.git#v1.0.0"
},
"react-native-keychain": {
"version": "7.0.0",
"resolved": "https://registry.npmjs.org/react-native-keychain/-/react-native-keychain-7.0.0.tgz",

View File

@ -139,7 +139,6 @@
"react-native-idle-timer": "https://github.com/BlueWallet/react-native-idle-timer#8587876d68ab5920e79619726aeca9e672beaf2b",
"react-native-image-picker": "3.5.0",
"react-native-inappbrowser-reborn": "https://github.com/BlueWallet/react-native-inappbrowser#fa2d8e1763e46dd12a7e53081e97a0f908049103",
"react-native-is-catalyst": "https://github.com/BlueWallet/react-native-is-catalyst#v1.0.0",
"react-native-keychain": "7.0.0",
"react-native-level-fs": "3.0.1",
"react-native-linear-gradient": "2.5.6",

View File

@ -20,9 +20,7 @@ import Clipboard from '@react-native-clipboard/clipboard';
import { Icon } from 'react-native-elements';
import Share from 'react-native-share';
import RNFS from 'react-native-fs';
import isCatalyst from 'react-native-is-catalyst';
import BigNumber from 'bignumber.js';
import { SafeBlueArea, BlueCard, BlueText } from '../../BlueComponents';
import navigationStyle from '../../components/navigationStyle';
import Privacy from '../../blue_modules/Privacy';
@ -30,6 +28,7 @@ import { BitcoinUnit } from '../../models/bitcoinUnits';
import loc from '../../loc';
import { BlueCurrentTheme } from '../../components/themes';
import { DynamicQRCode } from '../../components/DynamicQRCode';
import { isDesktop } from '../../blue_modules/environment';
const currency = require('../../blue_modules/currency');
export default class SendCreate extends Component {
@ -64,7 +63,7 @@ export default class SendCreate extends Component {
await RNFS.writeFile(filePath, this.state.tx);
Share.open({
url: 'file://' + filePath,
saveToFiles: isCatalyst,
saveToFiles: isDesktop,
})
.catch(error => {
console.log(error);

View File

@ -44,7 +44,6 @@ const currency = require('../../blue_modules/currency');
const prompt = require('../../blue_modules/prompt');
const fs = require('../../blue_modules/fs');
const scanqr = require('../../helpers/scan-qr');
const btcAddressRx = /^[a-zA-Z0-9]{26,35}$/;
const SendDetails = () => {

View File

@ -19,7 +19,7 @@ import Share from 'react-native-share';
import ReactNativeHapticFeedback from 'react-native-haptic-feedback';
import DocumentPicker from 'react-native-document-picker';
import { useNavigation, useRoute, useTheme } from '@react-navigation/native';
import { isCatalyst, isMacCatalina } from '../../blue_modules/environment';
import { isDesktop, isMacCatalina } from '../../blue_modules/environment';
import RNFS from 'react-native-fs';
import Biometric from '../../class/biometrics';
@ -188,7 +188,7 @@ const PsbtWithHardwareWallet = () => {
await RNFS.writeFile(filePath, typeof psbt === 'string' ? psbt : psbt.toBase64());
Share.open({
url: 'file://' + filePath,
saveToFiles: isCatalyst,
saveToFiles: isDesktop,
})
.catch(error => {
console.log(error);

View File

@ -5,7 +5,7 @@ import Notifications from '../../blue_modules/notifications';
import navigationStyle from '../../components/navigationStyle';
import { SafeBlueArea, BlueListItem } from '../../BlueComponents';
import loc from '../../loc';
import { isCatalyst } from '../../blue_modules/environment';
import { isDesktop } from '../../blue_modules/environment';
const NetworkSettings = () => {
const { navigate } = useNavigation();
@ -35,7 +35,7 @@ const NetworkSettings = () => {
chevron
/>
)}
{!isCatalyst && <BlueListItem title={loc.settings.tor_settings} onPress={navigateToTorSettings} testID="TorSettings" chevron />}
{!isDesktop && <BlueListItem title={loc.settings.tor_settings} onPress={navigateToTorSettings} testID="TorSettings" chevron />}
</ScrollView>
</SafeBlueArea>
);

View File

@ -32,7 +32,7 @@ import {
BlueDismissKeyboardInputAccessory,
} from '../../BlueComponents';
import { BlueCurrentTheme } from '../../components/themes';
import { isCatalyst } from '../../blue_modules/environment';
import { isDesktop } from '../../blue_modules/environment';
import ReactNativeHapticFeedback from 'react-native-haptic-feedback';
const BlueElectrum = require('../../blue_modules/BlueElectrum');
@ -268,7 +268,7 @@ export default class ElectrumSettings extends Component {
<TextInput
placeholder={
loc.formatString(loc.settings.electrum_host, { example: '111.222.333.111' }) +
(!isCatalyst ? ' (' + loc.settings.tor_supported + ')' : '')
(!isDesktop ? ' (' + loc.settings.tor_supported + ')' : '')
}
value={this.state.host}
onChangeText={text => this.setState({ host: text.trim() })}

View File

@ -12,7 +12,7 @@ import { LightningCustodianWallet } from '../../class/wallets/lightning-custodia
import loc from '../../loc';
import { BlueCurrentTheme } from '../../components/themes';
import DeeplinkSchemaMatch from '../../class/deeplink-schema-match';
import { isCatalyst } from '../../blue_modules/environment';
import { isDesktop } from '../../blue_modules/environment';
const styles = StyleSheet.create({
uri: {
@ -148,7 +148,7 @@ const LightningSettings = () => {
/>
</View>
<BlueSpacing20 />
{!isCatalyst && <BlueText style={[styles.torSupported]}>{loc.settings.tor_supported}</BlueText>}
{!isDesktop && <BlueText style={[styles.torSupported]}>{loc.settings.tor_supported}</BlueText>}
<BlueSpacing20 />
<BlueButtonLink title={loc.wallets.import_scan_qr} testID="ImportScan" onPress={importScan} />
<BlueSpacing20 />

View File

@ -40,7 +40,7 @@ import RNFS from 'react-native-fs';
import Share from 'react-native-share';
import { BlueStorageContext } from '../../blue_modules/storage-context';
import Notifications from '../../blue_modules/notifications';
import isCatalyst from 'react-native-is-catalyst';
import { isDesktop } from '../../blue_modules/environment';
import { AbstractHDElectrumWallet } from '../../class/wallets/abstract-hd-electrum-wallet';
const prompt = require('../../blue_modules/prompt');
@ -324,7 +324,7 @@ const WalletDetails = () => {
await RNFS.writeFile(filePath, contents);
Share.open({
url: 'file://' + filePath,
saveToFiles: isCatalyst,
saveToFiles: isDesktop,
})
.catch(error => {
console.log(error);

View File

@ -16,7 +16,7 @@ import navigationStyle from '../../components/navigationStyle';
import Privacy from '../../blue_modules/Privacy';
import WalletImport from '../../class/wallet-import';
import loc from '../../loc';
import { isCatalyst, isMacCatalina } from '../../blue_modules/environment';
import { isDesktop, isMacCatalina } from '../../blue_modules/environment';
const fs = require('../../blue_modules/fs');
const WalletsImport = () => {
@ -121,7 +121,7 @@ const WalletsImport = () => {
<BlueFormMultiInput
testID="MnemonicInput"
value={importText}
contextMenuHidden={!isCatalyst}
contextMenuHidden={!isDesktop}
onChangeText={setImportText}
inputAccessoryViewID={BlueDoneAndDismissKeyboardInputAccessory.InputAccessoryViewID}
/>

View File

@ -28,7 +28,7 @@ import loc from '../../loc';
import { FContainer, FButton } from '../../components/FloatButtons';
import { useFocusEffect, useNavigation, useRoute, useTheme } from '@react-navigation/native';
import { BlueStorageContext } from '../../blue_modules/storage-context';
import { isCatalyst, isMacCatalina, isTablet } from '../../blue_modules/environment';
import { isDesktop, isMacCatalina, isTablet } from '../../blue_modules/environment';
import BlueClipboard from '../../blue_modules/clipboard';
import navigationStyle from '../../components/navigationStyle';
@ -50,7 +50,7 @@ const WalletsList = () => {
const [isLoading, setIsLoading] = useState(false);
const [itemWidth, setItemWidth] = useState(width * 0.82 > 375 ? 375 : width * 0.82);
const [isLargeScreen, setIsLargeScreen] = useState(
Platform.OS === 'android' ? isTablet() : width >= Dimensions.get('screen').width / 2 && (isTablet() || isCatalyst),
Platform.OS === 'android' ? isTablet() : width >= Dimensions.get('screen').width / 2 && (isTablet() || isDesktop),
);
const [carouselData, setCarouselData] = useState([]);
const dataSource = getTransactions(null, 10);
@ -119,7 +119,7 @@ const WalletsList = () => {
useEffect(() => {
setOptions({
title: '',
headerShown: !isCatalyst,
headerShown: !isDesktop,
headerStyle: {
backgroundColor: colors.customHeader,
borderBottomWidth: 0,
@ -217,7 +217,7 @@ const WalletsList = () => {
<Text textBreakStrategy="simple" style={[styles.listHeaderText, stylesHook.listHeaderText]}>
{`${loc.transactions.list_title}${' '}`}
</Text>
{isCatalyst && (
{isDesktop && (
<TouchableOpacity style={style} onPress={() => refreshTransactions(true)} disabled={isLoading}>
<Icon name="refresh" type="font-awesome" color={colors.feeText} />
</TouchableOpacity>
@ -422,7 +422,7 @@ const WalletsList = () => {
};
const onLayout = _e => {
setIsLargeScreen(Platform.OS === 'android' ? isTablet() : width >= Dimensions.get('screen').width / 2 && (isTablet() || isCatalyst));
setIsLargeScreen(Platform.OS === 'android' ? isTablet() : width >= Dimensions.get('screen').width / 2 && (isTablet() || isDesktop));
setItemWidth(width * 0.82 > 375 ? 375 : width * 0.82);
};

View File

@ -35,7 +35,7 @@ import { FContainer, FButton } from '../../components/FloatButtons';
import BottomModal from '../../components/BottomModal';
import BuyBitcoin from './buyBitcoin';
import { BlueStorageContext } from '../../blue_modules/storage-context';
import { isCatalyst, isMacCatalina } from '../../blue_modules/environment';
import { isDesktop, isMacCatalina } from '../../blue_modules/environment';
import BlueClipboard from '../../blue_modules/clipboard';
const fs = require('../../blue_modules/fs');
@ -225,7 +225,7 @@ const WalletTransactions = () => {
const renderListHeaderComponent = () => {
const style = {};
if (!isCatalyst) {
if (!isDesktop) {
// we need this button for testing
style.opacity = 0;
style.height = 1;