Commit 1d341776 by nguyenquangtung004

TODO: Đã fix xong để không bị lộ khoảng trắng của SafeAreaView

parent 4ffede00
...@@ -5,6 +5,7 @@ import { ...@@ -5,6 +5,7 @@ import {
Text, Text,
TouchableOpacity, TouchableOpacity,
View, View,
StatusBar,
} from 'react-native'; } from 'react-native';
import R from '../../assets/R'; import R from '../../assets/R';
import { import {
...@@ -13,14 +14,17 @@ import { ...@@ -13,14 +14,17 @@ import {
WIDTH, WIDTH,
} from '../../config/Functions'; } from '../../config/Functions';
import {useNavigation} from '@react-navigation/native'; import {useNavigation} from '@react-navigation/native';
const Header = props => { const Header = props => {
const {title, isBack, isSearch} = props; const {title, isBack, isSearch} = props;
const navigate = useNavigation(); const navigation = useNavigation();
const IconBack = R.images.icBack; const IconBack = R.images.icBack;
const IconSearch = R.images.icSearch; const IconSearch = R.images.icSearch;
return ( return (
<> <SafeAreaView style={styles.safeArea}>
<SafeAreaView> <StatusBar barStyle="light-content" backgroundColor={R.colors.blue500} />
<View style={styles.headerContainer}> <View style={styles.headerContainer}>
{isSearch && ( {isSearch && (
<TouchableOpacity <TouchableOpacity
...@@ -29,6 +33,7 @@ const Header = props => { ...@@ -29,6 +33,7 @@ const Header = props => {
<IconSearch stroke={R.colors.white} strokeWidth={2} width={20} height={20} /> <IconSearch stroke={R.colors.white} strokeWidth={2} width={20} height={20} />
</TouchableOpacity> </TouchableOpacity>
)} )}
<Text numberOfLines={1} style={styles.txtTitle}> <Text numberOfLines={1} style={styles.txtTitle}>
{title} {title}
</Text> </Text>
...@@ -36,21 +41,23 @@ const Header = props => { ...@@ -36,21 +41,23 @@ const Header = props => {
{isBack && ( {isBack && (
<TouchableOpacity <TouchableOpacity
style={styles.btnBack} style={styles.btnBack}
onPress={() => navigate.goBack()}> onPress={() => navigation.goBack()}>
<IconBack width={20} height={20} /> <IconBack width={20} height={20} />
</TouchableOpacity> </TouchableOpacity>
)} )}
</View> </View>
</SafeAreaView> </SafeAreaView>
</>
); );
}; };
export default Header; export default Header;
const styles = StyleSheet.create({ const styles = StyleSheet.create({
safeArea: {
backgroundColor: R.colors.blue500,
},
headerContainer: { headerContainer: {
height: HEIGHT(50), height: HEIGHT(30),
width: '100%', width: '100%',
flexDirection: 'row', flexDirection: 'row',
alignItems: 'center', alignItems: 'center',
...@@ -66,7 +73,6 @@ const styles = StyleSheet.create({ ...@@ -66,7 +73,6 @@ const styles = StyleSheet.create({
shadowRadius: 5, shadowRadius: 5,
elevation: 5, elevation: 5,
}, },
txtTitle: { txtTitle: {
flex: 1, flex: 1,
fontSize: getFontSize(16), fontSize: getFontSize(16),
......
...@@ -344,9 +344,7 @@ export default ProfileView; ...@@ -344,9 +344,7 @@ export default ProfileView;
const styles = StyleSheet.create({ const styles = StyleSheet.create({
container: { container: {
flex: 1, flex: 1,
backgroundColor: R.colors.white,
paddingHorizontal: 15, paddingHorizontal: 15,
paddingTop: 15,
paddingBottom: 9, paddingBottom: 9,
}, },
body_header: { body_header: {
......
...@@ -54,7 +54,7 @@ const DetailRollCallView = (props) => { ...@@ -54,7 +54,7 @@ const DetailRollCallView = (props) => {
}; };
return ( return (
<SafeAreaView style={styles.container}> <View style={styles.container}>
<Header <Header
isBack isBack
title={'Thông tin điểm danh lớp ADCV'} title={'Thông tin điểm danh lớp ADCV'}
...@@ -113,7 +113,7 @@ const DetailRollCallView = (props) => { ...@@ -113,7 +113,7 @@ const DetailRollCallView = (props) => {
</ScrollView> </ScrollView>
</View> </View>
</SafeAreaView> </View>
); );
}; };
......
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