Commit 7697c17b by Giang Tran

edit setting screen

parent 9665a612
...@@ -20,33 +20,35 @@ const SettingView = (props) => { ...@@ -20,33 +20,35 @@ const SettingView = (props) => {
const [isEnabled, setIsEnabled] = useState(true); const [isEnabled, setIsEnabled] = useState(true);
const toggleSwitch = () => setIsEnabled((previousState) => !previousState); const toggleSwitch = () => setIsEnabled((previousState) => !previousState);
const [language, setLanguage] = useState(dataTest[2]); const [language, setLanguage] = useState(dataTest[0].name);
return ( return (
<View style={{flex: 1}}> <View style={{flex: 1}}>
<HeaderBack title={'Cài đặt'} /> <HeaderBack title={'Cài đặt'} />
<View style={{flex: 1, padding: 10}}> <View style={{flex: 1, padding: 10}}>
<View style={styles.row}> <View style={styles.row}>
<Text style={styles.txtTitle}>Bt thông báo</Text>
<Switch
trackColor={{false: '#DBDBDB', true: '#1C6AF6'}}
ios_backgroundColor="#767577"
thumbColor={'#f4f3f4'}
onValueChange={toggleSwitch}
value={isEnabled}
/>
</View>
<View style={styles.row}>
<Text style={styles.txtTitle}>Ngôn ng</Text> <Text style={styles.txtTitle}>Ngôn ng</Text>
<PickerItem <PickerItem
defaultValue={language}
width={200} width={200}
value={language} value={language}
data={dataTest} data={dataTest}
onValueChange={(value, items) => { onValueChange={(value, items) => {
setLanguage(items); setLanguage(items.name);
}} }}
/> />
</View> </View>
<View style={styles.row}>
<Text style={styles.txtTitle}>Bt thông báo</Text>
<Switch
trackColor={{false: '#767577', true: '#1C6AF6'}}
ios_backgroundColor="#767577"
onValueChange={toggleSwitch}
value={isEnabled}
/>
</View>
</View> </View>
<Text>SettingView 1 screen</Text> <Text>SettingView 1 screen</Text>
......
...@@ -7,6 +7,7 @@ import { ...@@ -7,6 +7,7 @@ import {
TouchableOpacity, TouchableOpacity,
TouchableHighlight, TouchableHighlight,
Dimensions, Dimensions,
Platform,
} from 'react-native'; } from 'react-native';
import ModalDropdown from 'react-native-modal-dropdown'; import ModalDropdown from 'react-native-modal-dropdown';
import R from '../../assets/R'; import R from '../../assets/R';
...@@ -216,6 +217,7 @@ const styles = StyleSheet.create({ ...@@ -216,6 +217,7 @@ const styles = StyleSheet.create({
shadowOpacity: 0.2, shadowOpacity: 0.2,
shadowRadius: 1.41, shadowRadius: 1.41,
elevation: 2, elevation: 2,
marginTop: Platform.OS == 'ios' ? 0 : -21,
}, },
dropdown_row: { dropdown_row: {
flexDirection: 'row', flexDirection: 'row',
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment