2020-07-20 15:38:46 +02:00
|
|
|
import React from 'react';
|
2021-03-22 12:54:17 +01:00
|
|
|
import { ScrollView } from 'react-native';
|
2024-09-18 04:00:58 +02:00
|
|
|
import { isNotificationsCapable } from '../../blue_modules/notifications';
|
2023-12-16 22:44:35 +01:00
|
|
|
import ListItem from '../../components/ListItem';
|
2024-05-20 11:54:13 +02:00
|
|
|
import loc from '../../loc';
|
2024-09-18 04:00:58 +02:00
|
|
|
import { useExtendedNavigation } from '../../hooks/useExtendedNavigation';
|
2020-07-20 15:38:46 +02:00
|
|
|
|
2024-09-18 04:00:58 +02:00
|
|
|
const NetworkSettings: React.FC = () => {
|
|
|
|
const navigation = useExtendedNavigation();
|
2020-03-30 05:41:02 +02:00
|
|
|
|
2020-07-15 19:32:59 +02:00
|
|
|
const navigateToElectrumSettings = () => {
|
2024-09-18 04:00:58 +02:00
|
|
|
navigation.navigate('ElectrumSettings');
|
2020-07-15 19:32:59 +02:00
|
|
|
};
|
|
|
|
|
|
|
|
const navigateToLightningSettings = () => {
|
2024-09-18 04:00:58 +02:00
|
|
|
navigation.navigate('LightningSettings');
|
|
|
|
};
|
|
|
|
|
|
|
|
const navigateToBlockExplorerSettings = () => {
|
|
|
|
navigation.navigate('SettingsBlockExplorer');
|
2020-07-15 19:32:59 +02:00
|
|
|
};
|
|
|
|
|
2020-07-20 15:38:46 +02:00
|
|
|
return (
|
2024-01-13 15:56:29 +01:00
|
|
|
<ScrollView contentInsetAdjustmentBehavior="automatic" automaticallyAdjustContentInsets>
|
2024-09-18 04:00:58 +02:00
|
|
|
<ListItem title={loc.settings.block_explorer} onPress={navigateToBlockExplorerSettings} testID="BlockExplorerSettings" chevron />
|
2024-01-13 15:56:29 +01:00
|
|
|
<ListItem title={loc.settings.network_electrum} onPress={navigateToElectrumSettings} testID="ElectrumSettings" chevron />
|
|
|
|
<ListItem title={loc.settings.lightning_settings} onPress={navigateToLightningSettings} testID="LightningSettings" chevron />
|
2024-09-18 04:00:58 +02:00
|
|
|
{isNotificationsCapable && (
|
2024-01-13 15:56:29 +01:00
|
|
|
<ListItem
|
|
|
|
title={loc.settings.notifications}
|
2024-09-18 04:00:58 +02:00
|
|
|
onPress={() => navigation.navigate('NotificationSettings')}
|
2024-01-13 15:56:29 +01:00
|
|
|
testID="NotificationSettings"
|
|
|
|
chevron
|
|
|
|
/>
|
|
|
|
)}
|
|
|
|
</ScrollView>
|
2020-03-30 05:41:02 +02:00
|
|
|
);
|
|
|
|
};
|
2020-12-25 17:09:53 +01:00
|
|
|
|
2020-03-30 05:41:02 +02:00
|
|
|
export default NetworkSettings;
|