BlueWallet/screen/settings/NetworkSettings.js

43 lines
1.3 KiB
JavaScript
Raw Normal View History

2020-03-30 05:41:02 +02:00
import React, { useEffect, useState } from 'react';
import { ScrollView, TouchableOpacity, StyleSheet } from 'react-native';
2020-03-30 05:41:02 +02:00
import { BlueNavigationStyle, BlueLoading, SafeBlueArea, BlueListItem } from '../../BlueComponents';
2020-05-27 13:12:17 +02:00
import { useNavigation } from '@react-navigation/native';
2020-03-30 05:41:02 +02:00
const loc = require('../../loc');
const styles = StyleSheet.create({
root: {
flex: 1,
},
});
2020-03-30 05:41:02 +02:00
const NetworkSettings = () => {
const [isLoading, setIsLoading] = useState(true);
const { navigate } = useNavigation();
useEffect(() => {
setIsLoading(false);
2020-04-02 18:47:13 +02:00
}, []);
2020-03-30 05:41:02 +02:00
return isLoading ? (
<BlueLoading />
) : (
<SafeBlueArea forceInset={{ horizontal: 'always' }} style={styles.root}>
2020-03-30 05:41:02 +02:00
<ScrollView>
<BlueListItem title={'Electrum server'} component={TouchableOpacity} onPress={() => navigate('ElectrumSettings')} chevron />
<BlueListItem
title={loc.settings.lightning_settings}
component={TouchableOpacity}
onPress={() => navigate('LightningSettings')}
chevron
/>
<BlueListItem title="Broadcast transaction" component={TouchableOpacity} onPress={() => navigate('Broadcast')} chevron />
2020-03-30 05:41:02 +02:00
</ScrollView>
</SafeBlueArea>
);
};
NetworkSettings.navigationOptions = {
...BlueNavigationStyle(),
title: 'Network',
};
export default NetworkSettings;