-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathSetting.jsx
87 lines (65 loc) · 2 KB
/
Setting.jsx
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
import { StatusBar } from 'expo-status-bar';
import { useEffect, useState } from 'react';
import { StyleSheet, Text, View, TouchableOpacity, TextInput } from 'react-native';
export default function SettingScreen({navigation, route}) {
const [count, setCount] = useState(0)
const [score, setScore] = useState(0)
// Only for Text Input Value
const [text, setText] = useState()
applyFontBtnPressed=()=>{
global.fontsize=text
console.log('What is in TEXT Variable',global.fontsize)
navigation.navigate('Home')
}
useEffect(()=>{
// console.log('Kuch Bhi nahin')
})
useEffect(()=>{
// console.log('Only [] Bracket')
return()=>{
console.log('Yes i am going back from setting screen')
}
},[])
useEffect(()=>{
// console.log('Only Count')
},[count])
useEffect(()=>{
// console.log('Only Score')
},[score])
useEffect(()=>{
// console.log('Count and Score')
},[count, score])
useEffect(()=>{
// console.log('text is = ',text)
},[text])
useEffect(()=>{
const unsubscribe = navigation.addListener('focus',()=>{
console.log('Next Screen')
// setFont(global.fontsize)
})
return unsubscribe
}, [])
return (
<View style={styles.container}>
{/* {console.log('Setting return')} */}
<Text style={{marginTop:30, fontSize:30}}>set Font</Text>
<TextInput
style={{marginTop:20, backgroundColor:'lightgrey', width:120, height:40, fontSize:30}}
onChangeText={setText}
value={text}
/>
<TouchableOpacity onPress={()=>applyFontBtnPressed()}>
<Text style={{marginTop:10,fontSize:30, backgroundColor:'lightgrey'}}>Apply</Text>
</TouchableOpacity>
</View>
);
}
const styles = StyleSheet.create({
container: {
flex: 1,
backgroundColor: '#fff',
marginTop:100,
// alignItems: 'center',
// justifyContent: 'center',
},
});