-
-
Notifications
You must be signed in to change notification settings - Fork 146
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
5 changed files
with
308 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
207 changes: 207 additions & 0 deletions
207
views/Settings/EmbeddedNode/Chantools/Sweepremoteclosed.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,207 @@ | ||
import * as React from 'react'; | ||
import { ScrollView, StyleSheet, View } from 'react-native'; | ||
|
||
import Button from '../../../../components/Button'; | ||
import DropdownSetting from '../../../../components/DropdownSetting'; | ||
import Header from '../../../../components/Header'; | ||
import OnchainFeeInput from '../../../../components/OnchainFeeInput'; | ||
import Screen from '../../../../components/Screen'; | ||
import Text from '../../../../components/Text'; | ||
import TextInput from '../../../../components/TextInput'; | ||
|
||
import { localeString } from '../../../../utils/LocaleUtils'; | ||
import { themeColor } from '../../../../utils/ThemeUtils'; | ||
|
||
export const API_URL_KEYS = [ | ||
{ | ||
key: 'https://blockstream.info/api', | ||
value: 'https://blockstream.info/api' | ||
}, | ||
{ key: 'https://mempool.space/api', value: 'https://mempool.space/api' }, | ||
{ key: 'Custom', value: 'Custom' } | ||
]; | ||
|
||
interface SweepremoteclosedProps { | ||
navigation: any; | ||
} | ||
|
||
interface SweepremoteclosedState { | ||
seed: string; | ||
sweepAddr: string; | ||
apiUrl: string; | ||
customApiUrl: string; | ||
feeRate: string; | ||
recoveryWindow: string; | ||
loading: boolean; | ||
} | ||
|
||
export default class Sweepremoteclosed extends React.Component< | ||
SweepremoteclosedProps, | ||
SweepremoteclosedState | ||
> { | ||
state = { | ||
seed: '', | ||
sweepAddr: '', | ||
apiUrl: 'https://mempool.space/api', | ||
customApiUrl: '', | ||
feeRate: '21', | ||
recoveryWindow: '200', | ||
loading: false | ||
}; | ||
|
||
render() { | ||
const { navigation } = this.props; | ||
const { | ||
seed, | ||
sweepAddr, | ||
apiUrl, | ||
customApiUrl, | ||
feeRate, | ||
recoveryWindow, | ||
loading | ||
} = this.state; | ||
return ( | ||
<Screen> | ||
<View style={{ flex: 1 }}> | ||
<Header | ||
leftComponent="Back" | ||
centerComponent={{ | ||
text: 'sweepremoteclosed', | ||
style: { | ||
color: themeColor('text'), | ||
fontFamily: 'PPNeueMontreal-Book' | ||
} | ||
}} | ||
navigation={navigation} | ||
/> | ||
<ScrollView style={{ margin: 10 }}> | ||
<> | ||
<Text style={styles.text}> | ||
{localeString( | ||
'views.Settings.EmbeddedNode.Chantools.Sweepremoteclosed.seed' | ||
)} | ||
</Text> | ||
<TextInput | ||
placeholder={ | ||
'cherry truth mask employ box silver mass bunker fiscal vote' | ||
} | ||
value={seed} | ||
onChangeText={(text: string) => | ||
this.setState({ | ||
seed: text | ||
}) | ||
} | ||
locked={loading} | ||
/> | ||
</> | ||
<> | ||
<Text style={styles.text}> | ||
{localeString( | ||
'views.Settings.EmbeddedNode.Chantools.Sweepremoteclosed.sweepAddr' | ||
)} | ||
</Text> | ||
<TextInput | ||
value={sweepAddr} | ||
onChangeText={(text: string) => | ||
this.setState({ | ||
sweepAddr: text | ||
}) | ||
} | ||
locked={loading} | ||
/> | ||
</> | ||
<> | ||
<Text style={styles.text}> | ||
{localeString('views.Send.feeSatsVbyte')} | ||
</Text> | ||
<OnchainFeeInput | ||
fee={feeRate} | ||
onChangeFee={(text: string) => { | ||
this.setState({ | ||
feeRate: text | ||
}); | ||
}} | ||
/> | ||
</> | ||
<> | ||
<Text style={styles.text}> | ||
{localeString( | ||
'views.Settings.EmbeddedNode.Chantools.Sweepremoteclosed.recoveryWindow' | ||
)} | ||
</Text> | ||
<TextInput | ||
placeholder={'200'} | ||
value={recoveryWindow} | ||
onChangeText={(text: string) => | ||
this.setState({ | ||
recoveryWindow: text | ||
}) | ||
} | ||
locked={loading} | ||
keyboardType="numeric" | ||
/> | ||
</> | ||
<View style={{ marginTop: 10 }}> | ||
<DropdownSetting | ||
title={localeString( | ||
'views.Settings.EmbeddedNode.Chantools.Sweepremoteclosed.apiUrl' | ||
)} | ||
selectedValue={apiUrl} | ||
onValueChange={(value: string) => { | ||
this.setState({ | ||
apiUrl: value | ||
}); | ||
}} | ||
values={API_URL_KEYS} | ||
/> | ||
</View> | ||
{apiUrl === 'Custom' && ( | ||
<> | ||
<Text style={styles.text}> | ||
{localeString( | ||
'views.Settings.EmbeddedNode.Chantools.Sweepremoteclosed.customApiUrl' | ||
)} | ||
</Text> | ||
<TextInput | ||
value={customApiUrl} | ||
onChangeText={(text: string) => | ||
this.setState({ | ||
sweepAddr: text | ||
}) | ||
} | ||
locked={customApiUrl} | ||
/> | ||
</> | ||
)} | ||
</ScrollView> | ||
<View style={{ bottom: 10 }}> | ||
<View | ||
style={{ | ||
paddingTop: 30, | ||
paddingBottom: 15, | ||
paddingLeft: 10, | ||
paddingRight: 10 | ||
}} | ||
> | ||
<Button | ||
title={localeString( | ||
'views.Settings.EmbeddedNode.Chantools.Sweepremoteclosed.start' | ||
)} | ||
onPress={() => { | ||
console.log('start sweepremoteclosed'); | ||
}} | ||
/> | ||
</View> | ||
</View> | ||
</View> | ||
</Screen> | ||
); | ||
} | ||
} | ||
|
||
const styles = StyleSheet.create({ | ||
text: { | ||
fontFamily: 'PPNeueMontreal-Book', | ||
color: themeColor('secondaryText') | ||
} | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,62 @@ | ||
import * as React from 'react'; | ||
import { ScrollView, View } from 'react-native'; | ||
import { Icon, ListItem } from 'react-native-elements'; | ||
|
||
import Header from '../../../../components/Header'; | ||
import Screen from '../../../../components/Screen'; | ||
|
||
import { themeColor } from '../../../../utils/ThemeUtils'; | ||
|
||
interface ChantoolsProps { | ||
navigation: any; | ||
} | ||
|
||
export default class Chantools extends React.Component<ChantoolsProps, {}> { | ||
render() { | ||
const { navigation } = this.props; | ||
return ( | ||
<Screen> | ||
<View style={{ flex: 1 }}> | ||
<Header | ||
leftComponent="Back" | ||
centerComponent={{ | ||
text: 'chantools', | ||
style: { | ||
color: themeColor('text'), | ||
fontFamily: 'PPNeueMontreal-Book' | ||
} | ||
}} | ||
navigation={navigation} | ||
/> | ||
<ScrollView> | ||
<> | ||
<ListItem | ||
containerStyle={{ | ||
backgroundColor: 'transparent' | ||
}} | ||
onPress={() => | ||
navigation.navigate('Sweepremoteclosed') | ||
} | ||
> | ||
<ListItem.Content> | ||
<ListItem.Title | ||
style={{ | ||
color: themeColor('text'), | ||
fontFamily: 'PPNeueMontreal-Book' | ||
}} | ||
> | ||
sweepremoteclosed | ||
</ListItem.Title> | ||
</ListItem.Content> | ||
<Icon | ||
name="keyboard-arrow-right" | ||
color={themeColor('secondaryText')} | ||
/> | ||
</ListItem> | ||
</> | ||
</ScrollView> | ||
</View> | ||
</Screen> | ||
); | ||
} | ||
} |