BlueWallet/screen/settings/NetworkSettings.js

46 lines
1.5 KiB
JavaScript
Raw Normal View History

2020-07-20 15:38:46 +02:00
import React from 'react';
import { ScrollView } from 'react-native';
import { useNavigation } from '@react-navigation/native';
import Notifications from '../../blue_modules/notifications';
2020-12-25 17:09:53 +01:00
import navigationStyle from '../../components/navigationStyle';
import { SafeBlueArea, BlueListItem } from '../../BlueComponents';
2020-07-20 15:38:46 +02:00
import loc from '../../loc';
2020-03-30 05:41:02 +02:00
const NetworkSettings = () => {
const { navigate } = useNavigation();
2020-07-15 19:32:59 +02:00
const navigateToElectrumSettings = () => {
navigate('ElectrumSettings');
};
2021-04-23 13:29:45 +02:00
const navigateToTorSettings = () => {
navigate('TorSettings');
};
2020-07-15 19:32:59 +02:00
const navigateToLightningSettings = () => {
navigate('LightningSettings');
};
2020-07-20 15:38:46 +02:00
return (
<SafeBlueArea>
2020-03-30 05:41:02 +02:00
<ScrollView>
2021-03-01 11:20:01 +01:00
<BlueListItem title={loc.settings.network_electrum} onPress={navigateToElectrumSettings} testID="ElectrumSettings" chevron />
<BlueListItem title={loc.settings.lightning_settings} onPress={navigateToLightningSettings} testID="LightningSettings" chevron />
{Notifications.isNotificationsCapable && (
2021-04-11 22:53:05 +02:00
<BlueListItem
title={loc.settings.notifications}
onPress={() => navigate('NotificationSettings')}
testID="NotificationSettings"
chevron
/>
2021-04-02 13:27:17 +02:00
)}
2021-04-23 13:29:45 +02:00
<BlueListItem title={loc.settings.tor_settings} onPress={navigateToTorSettings} testID="TorSettings" chevron />
2020-03-30 05:41:02 +02:00
</ScrollView>
</SafeBlueArea>
);
};
2020-12-25 17:09:53 +01:00
2021-02-15 09:03:54 +01:00
NetworkSettings.navigationOptions = navigationStyle({}, opts => ({ ...opts, title: loc.settings.network }));
2020-12-25 17:09:53 +01:00
2020-03-30 05:41:02 +02:00
export default NetworkSettings;