77 TextInput ,
88 KeyboardAvoidingView ,
99 Platform ,
10+ Modal ,
1011} from 'react-native' ;
1112import { SafeAreaProvider , SafeAreaView } from 'react-native-safe-area-context' ;
1213
@@ -26,7 +27,6 @@ import 'moment/locale/es';
2627import 'moment/locale/pt' ;
2728import 'moment/locale/ru' ;
2829import { ButtonTypeEnum , GlobalConst , SelectServerEnum } from '../../app/AppState' ;
29- import { magicModal , useMagicModal } from 'react-native-magic-modal' ;
3030
3131type ImportUfvkProps = {
3232 onClickCancel : ( ) => void ;
@@ -36,11 +36,11 @@ const ImportUfvk: React.FunctionComponent<ImportUfvkProps> = ({ onClickCancel, o
3636 const context = useContext ( ContextAppLoading ) ;
3737 const { translate, netInfo, info, server, mode, addLastSnackbar, language, selectServer } = context ;
3838 const { colors } = useTheme ( ) as ThemeType ;
39- const { hide } = useMagicModal ( ) ;
4039 moment . locale ( language ) ;
4140
4241 const [ seedufvkText , setSeedufvkText ] = useState < string > ( '' ) ;
4342 const [ birthday , setBirthday ] = useState < string > ( '' ) ;
43+ const [ qrcodeModalVisible , setQrcodeModalVisible ] = useState < boolean > ( false ) ;
4444 const [ latestBlock , setLatestBlock ] = useState < number > ( 0 ) ;
4545
4646 useEffect ( ( ) => {
@@ -105,24 +105,7 @@ const ImportUfvk: React.FunctionComponent<ImportUfvkProps> = ({ onClickCancel, o
105105 addLastSnackbar ( { message : translate ( 'loadedapp.connection-error' ) as string } ) ;
106106 return ;
107107 }
108- onClickOKAndHide ( seedufvkText . trimEnd ( ) . trimStart ( ) , Number ( birthday ) ) ;
109- } ;
110-
111- const setQrcodeModalShow = ( ) => {
112- return magicModal . show ( ( ) => < ScannerUfvk
113- setUfvkText = { setSeedufvkText }
114- /> , { swipeDirection : undefined }
115- ) . promise ;
116- } ;
117-
118- const onClickCancelAndHide = ( ) => {
119- onClickCancel ( ) ;
120- hide ( ) ;
121- } ;
122-
123- const onClickOKAndHide = ( keyTextParm : string , birthdayParm : number ) => {
124- onClickOK ( keyTextParm , birthdayParm ) ;
125- hide ( ) ;
108+ onClickOK ( seedufvkText . trimEnd ( ) . trimStart ( ) , Number ( birthday ) ) ;
126109 } ;
127110
128111 return (
@@ -139,6 +122,13 @@ const ImportUfvk: React.FunctionComponent<ImportUfvkProps> = ({ onClickCancel, o
139122 height : '100%' ,
140123 backgroundColor : colors . background ,
141124 } } >
125+ < Modal
126+ animationType = "slide"
127+ transparent = { false }
128+ visible = { qrcodeModalVisible }
129+ onRequestClose = { ( ) => setQrcodeModalVisible ( false ) } >
130+ < ScannerUfvk setUfvkText = { setSeedufvkText } closeModal = { ( ) => setQrcodeModalVisible ( false ) } />
131+ </ Modal >
142132 < Header
143133 title = { translate ( 'import.title' ) as string }
144134 noBalance = { true }
@@ -148,7 +138,7 @@ const ImportUfvk: React.FunctionComponent<ImportUfvkProps> = ({ onClickCancel, o
148138 translate = { translate }
149139 netInfo = { netInfo }
150140 mode = { mode }
151- closeScreen = { onClickCancelAndHide }
141+ closeScreen = { onClickCancel }
152142 />
153143 < ScrollView
154144 keyboardShouldPersistTaps = "handled"
@@ -210,7 +200,7 @@ const ImportUfvk: React.FunctionComponent<ImportUfvkProps> = ({ onClickCancel, o
210200 ) }
211201 < TouchableOpacity
212202 onPress = { ( ) => {
213- setQrcodeModalShow ( ) ;
203+ setQrcodeModalVisible ( true ) ;
214204 } } >
215205 < FontAwesomeIcon size = { 35 } icon = { faQrcode } color = { colors . border } />
216206 </ TouchableOpacity >
0 commit comments