11import type { JsonObject } from 'edge-core-js'
22import * as React from 'react'
3- import { Platform , View } from 'react-native'
3+ import { Linking , Platform , View } from 'react-native'
44import { KeyboardAwareScrollView } from 'react-native-keyboard-aware-scroll-view'
55import { sprintf } from 'sprintf-js'
66
@@ -19,8 +19,10 @@ import {
1919import { useSelector } from '../../types/reactRedux'
2020import type { EdgeAppSceneProps } from '../../types/routerTypes'
2121import { SceneButtons } from '../buttons/SceneButtons'
22+ import { EdgeTouchableOpacity } from '../common/EdgeTouchableOpacity'
2223import { SceneWrapper } from '../common/SceneWrapper'
2324import { CryptoIcon } from '../icons/CryptoIcon'
25+ import { InformationCircleIcon } from '../icons/ThemedIcons'
2426import { ButtonsModal } from '../modals/ButtonsModal'
2527import { Airship , showError } from '../services/AirshipInstance'
2628import { cacheStyles , type Theme , useTheme } from '../services/ThemeContext'
@@ -299,27 +301,52 @@ const CreateWalletImportComponent = (props: Props): React.JSX.Element => {
299301 if ( item == null ) return null
300302
301303 const { value, error } = item
304+ const { knowledgeBaseUri } = opt . displayDescription ?? { }
305+
306+ const returnKeyType =
307+ opt . inputType === 'number-pad' && Platform . OS === 'ios'
308+ ? undefined
309+ : 'done'
302310
303311 return (
304- < FilledTextInput
305- key = { key }
306- aroundRem = { 0.5 }
307- placeholder = { `${ opt . displayName } ${
308- opt . required ? ` (${ lstrings . fragment_required } )` : ''
309- } `}
310- value = { value }
311- error = {
312- error ? lstrings . create_wallet_invalid_input : undefined
313- }
314- keyboardType = { opt . inputType }
315- autoCapitalize = "none"
316- autoCorrect = { false }
317- autoComplete = "off"
318- onChangeText = { ( text : string ) => {
319- handleOptionChange ( text , pluginId , opt )
320- } }
321- returnKeyType = "done"
322- />
312+ < View key = { key } style = { styles . optionRow } >
313+ < FilledTextInput
314+ aroundRem = { 0.5 }
315+ expand
316+ placeholder = { `${ opt . displayName } ${
317+ opt . required ? ` (${ lstrings . fragment_required } )` : ''
318+ } `}
319+ value = { value }
320+ error = {
321+ error ? lstrings . create_wallet_invalid_input : undefined
322+ }
323+ keyboardType = { opt . inputType }
324+ autoCapitalize = "none"
325+ autoCorrect = { false }
326+ autoComplete = "off"
327+ onChangeText = { ( text : string ) => {
328+ handleOptionChange ( text , pluginId , opt )
329+ } }
330+ returnKeyType = { returnKeyType }
331+ />
332+ { knowledgeBaseUri != null ? (
333+ < EdgeTouchableOpacity
334+ style = { styles . infoButton }
335+ onPress = { ( ) => {
336+ Linking . openURL ( knowledgeBaseUri ) . catch (
337+ ( err : unknown ) => {
338+ showError ( err )
339+ }
340+ )
341+ } }
342+ >
343+ < InformationCircleIcon
344+ size = { theme . rem ( 1.25 ) }
345+ color = { theme . iconTappable }
346+ />
347+ </ EdgeTouchableOpacity >
348+ ) : null }
349+ </ View >
323350 )
324351 } ) }
325352 </ View >
@@ -365,6 +392,13 @@ const getStyles = cacheStyles((theme: Theme) => ({
365392 pluginIdText : {
366393 fontSize : theme . rem ( 1 ) ,
367394 marginLeft : theme . rem ( 0.5 )
395+ } ,
396+ optionRow : {
397+ flexDirection : 'row' ,
398+ alignItems : 'center'
399+ } ,
400+ infoButton : {
401+ padding : theme . rem ( 0.5 )
368402 }
369403} ) )
370404
0 commit comments