1
- import React , { memo , ReactElement , useMemo , useState } from 'react' ;
1
+ import React , { memo , ReactElement , useMemo } from 'react' ;
2
2
import { Image , StyleSheet , TouchableOpacity } from 'react-native' ;
3
3
import { useTranslation } from 'react-i18next' ;
4
4
5
5
import { View as ThemedView } from '../../styles/components' ;
6
6
import { EItemType , IListData , ItemData } from '../../components/List' ;
7
7
import SafeAreaInset from '../../components/SafeAreaInset' ;
8
8
import SettingsView from './SettingsView' ;
9
- import { useAppDispatch , useAppSelector } from '../../hooks/redux' ;
10
- import { updateSettings } from '../../store/slices/settings' ;
11
- import { showToast } from '../../utils/notifications' ;
9
+ import {
10
+ // useAppDispatch,
11
+ useAppSelector ,
12
+ } from '../../hooks/redux' ;
13
+ // import { updateSettings } from '../../store/slices/settings';
14
+ // import { showToast } from '../../utils/notifications';
12
15
import { SettingsScreenProps } from '../../navigation/types' ;
13
16
import { enableDevOptionsSelector } from '../../store/reselect/settings' ;
14
17
import {
@@ -27,26 +30,26 @@ const MainSettings = ({
27
30
navigation,
28
31
} : SettingsScreenProps < 'MainSettings' > ) : ReactElement => {
29
32
const { t } = useTranslation ( 'settings' ) ;
30
- const dispatch = useAppDispatch ( ) ;
33
+ // const dispatch = useAppDispatch();
31
34
const enableDevOptions = useAppSelector ( enableDevOptionsSelector ) ;
32
- const [ enableDevOptionsCount , setEnableDevOptionsCount ] = useState ( 0 ) ;
35
+ // const [enableDevOptionsCount, setEnableDevOptionsCount] = useState(0);
33
36
34
- const updateDevOptions = ( ) : void => {
35
- const count = enableDevOptionsCount + 1 ;
36
- setEnableDevOptionsCount ( count ) ;
37
- if ( count >= 5 ) {
38
- const enabled = ! enableDevOptions ;
39
- dispatch ( updateSettings ( { enableDevOptions : enabled } ) ) ;
40
- showToast ( {
41
- type : 'success' ,
42
- title : t ( enabled ? 'dev_enabled_title' : 'dev_disabled_title' ) ,
43
- description : t (
44
- enabled ? 'dev_enabled_message' : 'dev_disabled_message' ,
45
- ) ,
46
- } ) ;
47
- setEnableDevOptionsCount ( 0 ) ;
48
- }
49
- } ;
37
+ // const updateDevOptions = (): void => {
38
+ // const count = enableDevOptionsCount + 1;
39
+ // setEnableDevOptionsCount(count);
40
+ // if (count >= 5) {
41
+ // const enabled = !enableDevOptions;
42
+ // dispatch(updateSettings({ enableDevOptions: enabled }));
43
+ // showToast({
44
+ // type: 'success',
45
+ // title: t(enabled ? 'dev_enabled_title' : 'dev_disabled_title'),
46
+ // description: t(
47
+ // enabled ? 'dev_enabled_message' : 'dev_disabled_message',
48
+ // ),
49
+ // });
50
+ // setEnableDevOptionsCount(0);
51
+ // }
52
+ // };
50
53
51
54
const listData : IListData [ ] = useMemo ( ( ) => {
52
55
const data : ItemData [ ] = [
@@ -116,7 +119,8 @@ const MainSettings = ({
116
119
style = { styles . imageContainer }
117
120
activeOpacity = { 1 }
118
121
testID = "DevOptions"
119
- onPress = { updateDevOptions } >
122
+ // onPress={updateDevOptions}
123
+ >
120
124
< Image style = { styles . image } source = { imageSrc } />
121
125
</ TouchableOpacity >
122
126
< SafeAreaInset type = "bottom" minPadding = { 16 } />
0 commit comments