From 2d663ac8e28dc84455486c5670e4af36e30f8492 Mon Sep 17 00:00:00 2001 From: Marcos Rodriguez Velez Date: Sun, 30 Jun 2024 13:17:55 -0400 Subject: [PATCH] REF: Replace abandoned package --- App.tsx | 14 +- android/build.gradle | 6 +- components/BottomModal.tsx | 125 ++++---- ios/Podfile.lock | 7 + package-lock.json | 57 ++-- package.json | 2 +- screen/lnd/ldkInfo.tsx | 6 +- screen/receive/details.js | 87 +++--- screen/send/SendDetails.tsx | 290 ++++++++++--------- screen/send/coinControl.js | 11 +- screen/wallets/ViewEditMultisigCosigners.tsx | 118 ++++---- screen/wallets/addMultisig.js | 143 ++++----- screen/wallets/addMultisigStep2.js | 152 +++++----- 13 files changed, 486 insertions(+), 532 deletions(-) diff --git a/App.tsx b/App.tsx index f549c7d02..0f1835c87 100644 --- a/App.tsx +++ b/App.tsx @@ -10,13 +10,25 @@ import { BlueDarkTheme, BlueDefaultTheme } from './components/themes'; import MasterView from './navigation/MasterView'; import { navigationRef } from './NavigationService'; import { StorageProvider } from './components/Context/StorageProvider'; +import { TrueSheet } from '@lodev09/react-native-true-sheet'; const App = () => { const colorScheme = useColorScheme(); + const onReady = () => { + // @ts-ignore: fix later + navigationRef.current?.addListener('beforeRemove', async (e: any) => { + if (e.data.action.type === 'NAVIGATE') { + e.preventDefault(); + await TrueSheet.dismiss('BottomModal'); + navigationRef.current?.dispatch(e.data.action); + } + }); + }; + return ( - + diff --git a/android/build.gradle b/android/build.gradle index e95c17143..4784039e9 100644 --- a/android/build.gradle +++ b/android/build.gradle @@ -5,8 +5,8 @@ buildscript { minSdkVersion = 24 supportLibVersion = "28.0.0" buildToolsVersion = "34.0.0" - compileSdkVersion = 33 - targetSdkVersion = 33 + compileSdkVersion = 34 + targetSdkVersion = 34 googlePlayServicesVersion = "16.+" googlePlayServicesIidVersion = "16.0.1" firebaseVersion = "17.3.4" @@ -63,7 +63,7 @@ subprojects { if (project.hasProperty("android")) { android { buildToolsVersion "34.0.0" - compileSdkVersion 33 + compileSdkVersion 34 defaultConfig { minSdkVersion 24 } diff --git a/components/BottomModal.tsx b/components/BottomModal.tsx index 57af993c7..ac8b5f143 100644 --- a/components/BottomModal.tsx +++ b/components/BottomModal.tsx @@ -1,83 +1,56 @@ -import React from 'react'; -import { Platform, StyleSheet, useWindowDimensions, View } from 'react-native'; -import Modal from 'react-native-modal'; +import React, { forwardRef, useImperativeHandle, useRef } from 'react'; +import { TrueSheet, TrueSheetProps } from '@lodev09/react-native-true-sheet'; -import { BlueSpacing10 } from '../BlueComponents'; -import loc from '../loc'; -import Button from './Button'; -import { useTheme } from './themes'; - -const styles = StyleSheet.create({ - root: { - justifyContent: 'flex-end', - margin: 0, - }, - hasDoneButton: { - padding: 16, - paddingBottom: 24, - }, -}); - -interface BottomModalProps { +interface BottomModalProps extends TrueSheetProps { children?: React.ReactNode; - onBackButtonPress?: () => void; - onBackdropPress?: () => void; - onClose: () => void; - windowHeight?: number; - windowWidth?: number; - doneButton?: boolean; - avoidKeyboard?: boolean; - allowBackdropPress?: boolean; - isVisible: boolean; - coverScreen?: boolean; + onClose?: () => void; + name?: string; + isGrabberVisible?: boolean; } -const BottomModal: React.FC = ({ - onBackButtonPress, - onBackdropPress, - onClose, - windowHeight, - windowWidth, - doneButton, - isVisible, - avoidKeyboard = false, - allowBackdropPress = true, - coverScreen = true, - ...props -}) => { - const { height: valueWindowHeight, width: valueWindowWidth } = useWindowDimensions(); - const handleBackButtonPress = onBackButtonPress ?? onClose; - const handleBackdropPress = allowBackdropPress ? onBackdropPress ?? onClose : undefined; - const { colors } = useTheme(); - const stylesHook = StyleSheet.create({ - hasDoneButton: { - backgroundColor: colors.elevated, - }, - }); +export interface BottomModalHandle { + present: () => Promise; + dismiss: () => Promise; +} - return ( - - {props.children} - {doneButton && ( - -