Commit f2e2f968 by tungnq

TODO: Format code

parent 89495241
import { Image, StyleSheet, TextInput, View, Platform, SafeAreaView, StatusBar } from "react-native"; import {
import React from "react"; Image,
import R from "../../assets/R"; StyleSheet,
import styles from "./style"; TextInput,
const HeaderHome = (props) => { View,
const { Platform,
value, SafeAreaView,
onChangeText, StatusBar,
} = props; } from 'react-native';
import React from 'react';
import R from '../../assets/R';
import styles from './style';
const HeaderHome = props => {
const {value, onChangeText} = props;
return ( return (
<SafeAreaView style={styles.containerBoxHeader}> <SafeAreaView style={styles.containerBoxHeader}>
<StatusBar <StatusBar
barStyle="light-content" barStyle="light-content"
translucent={false} translucent={false}
backgroundColor='black' backgroundColor="black"
/> />
<View style={styles.boxLogo}> <View style={styles.boxLogo}>
<Image <Image
...@@ -23,19 +27,19 @@ const HeaderHome = (props) => { ...@@ -23,19 +27,19 @@ const HeaderHome = (props) => {
resizeMode="contain" resizeMode="contain"
/> />
</View> </View>
<View style={{flex:1}}></View> <View style={{flex: 1}}></View>
<View style={styles.searchBox}> <View style={styles.searchBox}>
<View style={styles.boxIconSearch}> <View style={styles.boxIconSearch}>
<Image <Image
source={R.images.icSearchHeader} source={R.images.icSearchHeader}
maxWidth={Platform.OS === 'ios' ? 16: 20} maxWidth={Platform.OS === 'ios' ? 16 : 20}
maxHeight={Platform.OS === 'ios' ? 16 : 20} maxHeight={Platform.OS === 'ios' ? 16 : 20}
/> />
</View> </View>
<TextInput <TextInput
value={value} value={value}
onChangeText={onChangeText} onChangeText={onChangeText}
placeholder={"Tìm kiếm"} placeholder={'Tìm kiếm'}
placeholderTextColor={R.colors.white} placeholderTextColor={R.colors.white}
style={styles.input} style={styles.input}
/> />
...@@ -45,5 +49,3 @@ const HeaderHome = (props) => { ...@@ -45,5 +49,3 @@ const HeaderHome = (props) => {
}; };
export default HeaderHome; export default HeaderHome;
import React, { Component, useMemo, useState } from "react"; import React, {Component, useMemo, useState} from 'react';
import { View, Text, Linking } from "react-native"; import {View, Text, Linking} from 'react-native';
import * as SCREENNAME from '../../routers/ScreenNames' import * as SCREENNAME from '../../routers/ScreenNames';
import Homeview from "./view"; import Homeview from './view';
import R from "../../assets/R"; import R from '../../assets/R';
import { useNavigation } from '@react-navigation/native'; import {useNavigation} from '@react-navigation/native';
const Home = (props) => { const Home = props => {
const navigation = useNavigation(); const navigation = useNavigation();
const [selectedMenuItem, setSelectedMenuItem] = useState(""); const [selectedMenuItem, setSelectedMenuItem] = useState('');
const [searchText, setSearchText] = useState(""); const [searchText, setSearchText] = useState('');
const [userProfile, setUserProfile] = useState({ const [userProfile, setUserProfile] = useState({
name: "NGUYỄN MINH ĐỨC", name: 'NGUYỄN MINH ĐỨC',
phone: "0895457", phone: '0895457',
avatar: null, avatar: null,
}); });
const menuTeachingActivities = [ const menuTeachingActivities = [
{ id: 1, title: "Lịch dạy, coi thi", icon: R.images.icLichDay, screenName: SCREENNAME.DRAWERNAVIGATION,action: 'NAVIGATE',}, {
{ id: 2, title: "Báo nghỉ", icon: R.images.icBaoNghi, screenName: SCREENNAME.LISTRESTREPORT,action: 'NAVIGATE'}, id: 1,
{ id: 3, title: "Báo bù", icon: R.images.icBaoBu , screenName: SCREENNAME.LISTMAKEUPCLASSES,action: 'NAVIGATE',}, title: 'Lịch dạy, coi thi',
{ id: 4, title: "Xác nhận dạy thay", icon: R.images.icXacNhanDayThay,screenName: SCREENNAME.SUBTEACHER,action: 'NAVIGATE', }, icon: R.images.icLichDay,
{ id: 5, title: "Điểm danh", icon: R.images.icDiemDanh , screenName: SCREENNAME.LISTROLLCALL,action: 'NAVIGATE',}, screenName: SCREENNAME.DRAWERNAVIGATION,
{ id: 6, title: "Cố vấn học tập", icon: R.images.icCoVanHT,screenName: SCREENNAME.LISTACADEMICADVISOR,action: 'NAVIGATE', } action: 'NAVIGATE',
},
{
id: 2,
title: 'Báo nghỉ',
icon: R.images.icBaoNghi,
screenName: SCREENNAME.LISTRESTREPORT,
action: 'NAVIGATE',
},
{
id: 3,
title: 'Báo bù',
icon: R.images.icBaoBu,
screenName: SCREENNAME.LISTMAKEUPCLASSES,
action: 'NAVIGATE',
},
{
id: 4,
title: 'Xác nhận dạy thay',
icon: R.images.icXacNhanDayThay,
screenName: SCREENNAME.SUBTEACHER,
action: 'NAVIGATE',
},
{
id: 5,
title: 'Điểm danh',
icon: R.images.icDiemDanh,
screenName: SCREENNAME.LISTROLLCALL,
action: 'NAVIGATE',
},
{
id: 6,
title: 'Cố vấn học tập',
icon: R.images.icCoVanHT,
screenName: SCREENNAME.LISTACADEMICADVISOR,
action: 'NAVIGATE',
},
]; ];
const menuStatistics = [ const menuStatistics = [
{ {
id: 7, id: 7,
title: "Thống kê giảng dạy", title: 'Thống kê giảng dạy',
icon: R.images.icThongKe, icon: R.images.icThongKe,
screenName: SCREENNAME.STATISTICS, screenName: SCREENNAME.STATISTICS,
action: 'NAVIGATE', action: 'NAVIGATE',
}, },
{ id: 8, title: "Khảo sát sự kiện", icon: R.images.icKhaoSatSuKien ,screenName: SCREENNAME.HOMESCREEN,action: 'NAVIGATE',}, {
{ id: 9, title: "Kết quả đánh giá", icon: R.images.icKetQuaDanhGia,screenName: SCREENNAME.LISTFEEDBACK,action: 'NAVIGATE', }, id: 8,
title: 'Khảo sát sự kiện',
icon: R.images.icKhaoSatSuKien,
screenName: SCREENNAME.HOMESCREEN,
action: 'NAVIGATE',
},
{
id: 9,
title: 'Kết quả đánh giá',
icon: R.images.icKetQuaDanhGia,
screenName: SCREENNAME.LISTFEEDBACK,
action: 'NAVIGATE',
},
]; ];
const menuNotification = [ const menuNotification = [
{ id: 10, title: "Văn bản đến", icon: R.images.icVanBanDen,screenName: SCREENNAME.INCOMINGDOCUMENT,action: 'NAVIGATE', }, {
{ id: 11, title: "Văn bản đi", icon: R.images.icVanBanDi,screenName: SCREENNAME.LISTSENDDOCUMENT,action: 'NAVIGATE', }, id: 10,
{ id: 12, title: "Công việc", icon: R.images.icCongViec ,screenName: SCREENNAME.LISTWORK, action: 'NAVIGATE' }, title: 'Văn bản đến',
{ id: 13, title: "Mail", icon: R.images.icDChiThu,screenName: SCREENNAME.EMAIL, aciton: 'NAVIGATE'}, icon: R.images.icVanBanDen,
screenName: SCREENNAME.INCOMINGDOCUMENT,
action: 'NAVIGATE',
},
{
id: 11,
title: 'Văn bản đi',
icon: R.images.icVanBanDi,
screenName: SCREENNAME.LISTSENDDOCUMENT,
action: 'NAVIGATE',
},
{
id: 12,
title: 'Công việc',
icon: R.images.icCongViec,
screenName: SCREENNAME.LISTWORK,
action: 'NAVIGATE',
},
{
id: 13,
title: 'Mail',
icon: R.images.icDChiThu,
screenName: SCREENNAME.EMAIL,
aciton: 'NAVIGATE',
},
]; ];
//Hàm tìm kiếm trong local theo tiêu đề chỉ hoạt động khi thực hiện tìm kiếm (searchText) thay đổi //Hàm tìm kiếm trong local theo tiêu đề chỉ hoạt động khi thực hiện tìm kiếm (searchText) thay đổi
const [ const [filterActivity, filterStatics, filterNotification] = useMemo(() => {
filterActivity, if (!searchText.trim())
filterStatics, return [menuTeachingActivities, menuStatistics, menuNotification];
filterNotification,
] = useMemo(()=>{
if (!searchText.trim()) return [menuTeachingActivities, menuStatistics, menuNotification];
const toLowerCaseSearchText = searchText.toLowerCase(); const toLowerCaseSearchText = searchText.toLowerCase();
const filterByTitle = (list) => list.filter(item => item.title.toLowerCase().includes(toLowerCaseSearchText)); const filterByTitle = list =>
list.filter(item =>
item.title.toLowerCase().includes(toLowerCaseSearchText),
);
return [filterByTitle(menuTeachingActivities), filterByTitle(menuStatistics), filterByTitle(menuNotification)]; return [
},[searchText]) filterByTitle(menuTeachingActivities),
filterByTitle(menuStatistics),
filterByTitle(menuNotification),
];
}, [searchText]);
const actionHandlers = { const actionHandlers = {
NAVIGATE: (item) => { NAVIGATE: item => {
navigation.navigate(item.screenName, { navigation.navigate(item.screenName, {
...item.params, ...item.params,
itemData: item, itemData: item,
...@@ -63,23 +139,22 @@ const Home = (props) => { ...@@ -63,23 +139,22 @@ const Home = (props) => {
}); });
}, },
OPEN_URL: (item) => { OPEN_URL: item => {
Linking.openURL(item.url).catch((err) => { Linking.openURL(item.url).catch(err => {
console.error("Failed to open URL:", err); console.error('Failed to open URL:', err);
}); });
}, },
SHOW_MODAL: (item) => { SHOW_MODAL: item => {
console.log("Show modal for:", item.title); console.log('Show modal for:', item.title);
}, },
CALL_API: (item) => { CALL_API: item => {
console.log("Calling API for:", item.title); console.log('Calling API for:', item.title);
}, },
}; };
const handleMenuItemPress = (item) => { const handleMenuItemPress = item => {
const handler = actionHandlers[item.action]; const handler = actionHandlers[item.action];
if (handler) { if (handler) {
handler(item); handler(item);
...@@ -88,7 +163,7 @@ const Home = (props) => { ...@@ -88,7 +163,7 @@ const Home = (props) => {
} }
}; };
const handleSearchChange = (text) => { const handleSearchChange = text => {
setSearchText(text); setSearchText(text);
}; };
......
import React from "react"; import React from 'react';
import { View, Text, StyleSheet, Image, TouchableOpacity } from "react-native"; import {View, Text, StyleSheet, Image, TouchableOpacity} from 'react-native';
import styles from "./style"; import styles from './style';
const ItemGrid = ({ item ,onPress }) => { const ItemGrid = ({item, onPress}) => {
return ( return (
<TouchableOpacity <TouchableOpacity onPress={onPress} style={styles.menu_item}>
onPress={onPress}
style={styles.menu_item}
>
<View style={styles.icon_container}> <View style={styles.icon_container}>
<Image <Image source={item.icon} style={styles.icon} />
source={item.icon}
style={styles.icon}
/>
</View> </View>
<Text style={styles.menu_text}>{item.title}</Text> <Text style={styles.menu_text}>{item.title}</Text>
</TouchableOpacity> </TouchableOpacity>
...@@ -19,4 +13,3 @@ const ItemGrid = ({ item ,onPress }) => { ...@@ -19,4 +13,3 @@ const ItemGrid = ({ item ,onPress }) => {
}; };
export default ItemGrid; export default ItemGrid;
import { StyleSheet } from "react-native"; import {StyleSheet} from 'react-native';
import R from "../../assets/R"; import R from '../../assets/R';
const styles = StyleSheet.create({ const styles = StyleSheet.create({
//Header //Header
containerBoxHeader: { containerBoxHeader: {
flexDirection: "row", flexDirection: 'row',
marginHorizontal: 15, marginHorizontal: 15,
maxHeight: 40, maxHeight: 40,
marginTop:15 marginTop: 15,
}, },
boxLogo:{ boxLogo: {
flex: 2, flex: 2,
maxWidth: 75, maxWidth: 75,
maxHeight:36, maxHeight: 36,
}, },
boxIconSearch:{ boxIconSearch: {
padding:2, padding: 2,
}, },
searchBox: { searchBox: {
flex: 3, flex: 3,
flexDirection: "row", flexDirection: 'row',
backgroundColor: R.colors.blackBackgroundInputTextHeader, backgroundColor: R.colors.blackBackgroundInputTextHeader,
alignItems: "center", alignItems: 'center',
borderColor: R.colors.grayBorderInputTextHeader, borderColor: R.colors.grayBorderInputTextHeader,
borderRadius: 100, borderRadius: 100,
borderWidth: 1, borderWidth: 1,
...@@ -37,140 +37,138 @@ const styles = StyleSheet.create({ ...@@ -37,140 +37,138 @@ const styles = StyleSheet.create({
fontWeight: '400', fontWeight: '400',
}, },
//Home //Home
safeArea: { safeArea: {
flex: 1, flex: 1,
}, },
container_body: { container_body: {
flex: 1, flex: 1,
backgroundColor: R.colors.white, backgroundColor: R.colors.white,
}, },
background_header: { background_header: {
height: 295, height: 295,
position: 'relative', position: 'relative',
}, },
profileCard: { profileCard: {
position: 'absolute', position: 'absolute',
bottom: -30, bottom: -30,
flexDirection: "row", flexDirection: 'row',
alignItems: "center", alignItems: 'center',
backgroundColor: R.colors.white, backgroundColor: R.colors.white,
paddingVertical: 10, paddingVertical: 10,
paddingHorizontal: 15, paddingHorizontal: 15,
marginHorizontal: 15, marginHorizontal: 15,
borderRadius: 15, borderRadius: 15,
shadowColor: R.colors.black, shadowColor: R.colors.black,
shadowOffset: { width: 0, height: 1 }, shadowOffset: {width: 0, height: 1},
shadowOpacity: 0.5, shadowOpacity: 0.5,
shadowRadius: 1, shadowRadius: 1,
elevation: 1, elevation: 1,
}, },
profile_left: { profile_left: {
flexDirection: "row", flexDirection: 'row',
alignItems: "center", alignItems: 'center',
flex: 3, flex: 3,
}, },
avatar: { avatar: {
width: Platform.OS === 'ios' ? 37 : 47, width: Platform.OS === 'ios' ? 37 : 47,
height: Platform.OS === 'ios' ? 37 : 47, height: Platform.OS === 'ios' ? 37 : 47,
borderRadius: 100, borderRadius: 100,
backgroundColor: R.colors.gray, backgroundColor: R.colors.gray,
overflow: 'hidden', overflow: 'hidden',
}, },
avatar_image: { avatar_image: {
width: '100%', width: '100%',
height: '100%', height: '100%',
}, },
avatar_placeholder: { avatar_placeholder: {
width: '100%', width: '100%',
height: '100%', height: '100%',
justifyContent: 'center', justifyContent: 'center',
alignItems: 'center', alignItems: 'center',
backgroundColor: R.colors.blue, backgroundColor: R.colors.blue,
}, },
avatar_text: { avatar_text: {
fontSize: R.sizes.h6, fontSize: R.sizes.h6,
color: R.colors.white, color: R.colors.white,
fontFamily: R.fonts.fontMedium, fontFamily: R.fonts.fontMedium,
}, },
information: { information: {
flex: 2, flex: 2,
marginLeft: 10, marginLeft: 10,
}, },
text_card_info: { text_card_info: {
fontSize: R.sizes.md, fontSize: R.sizes.md,
fontWeight: "400", fontWeight: '400',
color: R.colors.black, color: R.colors.black,
fontFamily: R.fonts.InterRegular, fontFamily: R.fonts.InterRegular,
}, },
profile_btn: { profile_btn: {
paddingVertical: 5, paddingVertical: 5,
paddingHorizontal: 10, paddingHorizontal: 10,
backgroundColor: R.colors.grayButton, backgroundColor: R.colors.grayButton,
borderRadius: 15, borderRadius: 15,
flexDirection: "row", flexDirection: 'row',
justifyContent: 'center', justifyContent: 'center',
alignItems: 'center', alignItems: 'center',
}, },
iconNext: { iconNext: {
marginLeft: 5, marginLeft: 5,
}, },
btn_text: { btn_text: {
fontSize: R.sizes.sm, fontSize: R.sizes.sm,
fontWeight: "400", fontWeight: '400',
color: R.colors.black, color: R.colors.black,
fontFamily: R.fonts.fontRegular, fontFamily: R.fonts.fontRegular,
},
},
menu_container: {
marginHorizontal: 15,
},
menu_title: {
fontSize: R.fontsize.fontsSizeSubTitle,
fontWeight: "600",
color: R.colors.black,
fontFamily: R.fonts.InterMedium,
},
scroll: {
flex: 1,
marginTop: 35,
},
cardItemEmpty: {
flex: 1,
justifyContent: "center",
alignItems: "center",
},
//Item menu_container: {
menu_item: { marginHorizontal: 15,
alignItems: "center", },
paddingVertical: 10, menu_title: {
paddingHorizontal: 5, fontSize: R.fontsize.fontsSizeSubTitle,
marginHorizontal: 5, fontWeight: '600',
marginVertical: 5, color: R.colors.black,
flex: 1, fontFamily: R.fonts.InterMedium,
maxWidth: "30%", },
minHeight:"30%" scroll: {
}, flex: 1,
icon_container: { marginTop: 35,
width: 35, },
height: 35, cardItemEmpty: {
backgroundColor:R.colors.white, flex: 1,
}, justifyContent: 'center',
icon:{ alignItems: 'center',
width: 35, },
height: 35,
resizeMode: "contain", //Item
}, menu_item: {
menu_text: { alignItems: 'center',
fontSize: R.sizes.sm, paddingVertical: 10,
fontWeight: "600", paddingHorizontal: 5,
color: R.colors.black, marginHorizontal: 5,
fontFamily: R.fonts.fontMedium, marginVertical: 5,
textAlign: "center", flex: 1,
}, maxWidth: '30%',
minHeight: '30%',
}); },
icon_container: {
width: 35,
height: 35,
backgroundColor: R.colors.white,
},
icon: {
width: 35,
height: 35,
resizeMode: 'contain',
},
menu_text: {
fontSize: R.sizes.sm,
fontWeight: '600',
color: R.colors.black,
fontFamily: R.fonts.fontMedium,
textAlign: 'center',
},
});
export default styles; export default styles;
\ No newline at end of file
import React from "react"; import React from 'react';
import { import {
View, View,
Text, Text,
...@@ -10,17 +10,17 @@ import { ...@@ -10,17 +10,17 @@ import {
Keyboard, Keyboard,
SafeAreaView, SafeAreaView,
Image, Image,
StatusBar, StatusBar,
Platform, Platform,
} from "react-native"; } from 'react-native';
import HeaderCus from "../home/header"; import HeaderCus from '../home/header';
import R from "../../assets/R"; import R from '../../assets/R';
import ItemGrid from "./item"; import ItemGrid from './item';
import styles from "./style"; import styles from './style';
import { useNavigation } from "@react-navigation/native"; import {useNavigation} from '@react-navigation/native';
import * as SCREENNAME from "../../routers/ScreenNames"; import * as SCREENNAME from '../../routers/ScreenNames';
const HomeView = (props) => { const HomeView = props => {
const { const {
menuActivity, menuActivity,
menuStatistics, menuStatistics,
...@@ -33,7 +33,7 @@ const HomeView = (props) => { ...@@ -33,7 +33,7 @@ const HomeView = (props) => {
} = props; } = props;
const navigate = useNavigation(); const navigate = useNavigation();
const renderMenuItem = ({ item }) => { const renderMenuItem = ({item}) => {
return <ItemGrid item={item} onPress={() => onMenuItemPress(item)} />; return <ItemGrid item={item} onPress={() => onMenuItemPress(item)} />;
}; };
...@@ -44,48 +44,42 @@ const HomeView = (props) => { ...@@ -44,48 +44,42 @@ const HomeView = (props) => {
<View style={styles.avatar}> <View style={styles.avatar}>
{userProfile?.avatar ? ( {userProfile?.avatar ? (
<Image <Image
source={{ uri: userProfile.avatar }} source={{uri: userProfile.avatar}}
style={styles.avatar_image} style={styles.avatar_image}
resizeMode="cover" resizeMode="cover"
/> />
) : ( ) : (
<View style={styles.avatar_placeholder}> <View style={styles.avatar_placeholder}>
<Text style={styles.avatar_text}> <Text style={styles.avatar_text}>
{userProfile?.name?.charAt(0) || "U"} {userProfile?.name?.charAt(0) || 'U'}
</Text> </Text>
</View> </View>
)} )}
</View> </View>
<View style={styles.information}> <View style={styles.information}>
<Text <Text
style={styles.text_card_info} style={styles.text_card_info}
numberOfLines={1} numberOfLines={1}
ellipsizeMode="tail" ellipsizeMode="tail">
> {userProfile?.name ?? 'Không có dữ liệu'}
{userProfile?.name ?? "Không có dữ liệu"}
</Text> </Text>
<Text <Text
style={styles.text_card_info} style={styles.text_card_info}
numberOfLines={1} numberOfLines={1}
ellipsizeMode="tail" ellipsizeMode="tail">
> {userProfile?.phone ?? 'Không có dữ liệu'}
{userProfile?.phone ?? "Không có dữ liệu"}
</Text> </Text>
</View> </View>
</View> </View>
<TouchableOpacity <TouchableOpacity
style={styles.profile_btn} style={styles.profile_btn}
onPress={() => navigate.navigate(SCREENNAME.PROFILE)} onPress={() => navigate.navigate(SCREENNAME.PROFILE)}
activeOpacity={0.7} activeOpacity={0.7}>
>
<Text style={styles.btn_text}>H sơ cá nhân</Text> <Text style={styles.btn_text}>H sơ cá nhân</Text>
<View style={styles.iconNext}> <View style={styles.iconNext}>
<Image <Image source={R.images.icNext} style={{width: 5, height: 10}} />
source={R.images.icNext}
style={{ width: 5, height: 10 }}
/>
</View> </View>
</TouchableOpacity> </TouchableOpacity>
</View> </View>
...@@ -100,12 +94,12 @@ const HomeView = (props) => { ...@@ -100,12 +94,12 @@ const HomeView = (props) => {
data={menuActivity} data={menuActivity}
renderItem={renderMenuItem} renderItem={renderMenuItem}
numColumns={3} numColumns={3}
keyExtractor={(item) => item.id.toString()} keyExtractor={item => item.id.toString()}
scrollEnabled={false} scrollEnabled={false}
columnWrapperStyle={styles.row} columnWrapperStyle={styles.row}
ListEmptyComponent={renderItemEmpty} ListEmptyComponent={renderItemEmpty}
removeClippedSubviews={true} removeClippedSubviews={true}
maxToRenderPerBatch={9} maxToRenderPerBatch={9}
/> />
</View> </View>
); );
...@@ -119,7 +113,7 @@ const HomeView = (props) => { ...@@ -119,7 +113,7 @@ const HomeView = (props) => {
data={menuStatistics} data={menuStatistics}
renderItem={renderMenuItem} renderItem={renderMenuItem}
numColumns={3} numColumns={3}
keyExtractor={(item) => item.id.toString()} keyExtractor={item => item.id.toString()}
scrollEnabled={false} scrollEnabled={false}
columnWrapperStyle={styles.row} columnWrapperStyle={styles.row}
ListEmptyComponent={renderItemEmpty} ListEmptyComponent={renderItemEmpty}
...@@ -138,7 +132,7 @@ const HomeView = (props) => { ...@@ -138,7 +132,7 @@ const HomeView = (props) => {
data={menuNotification} data={menuNotification}
renderItem={renderMenuItem} renderItem={renderMenuItem}
numColumns={3} numColumns={3}
keyExtractor={(item) => item.id.toString()} keyExtractor={item => item.id.toString()}
scrollEnabled={false} scrollEnabled={false}
columnWrapperStyle={styles.row} columnWrapperStyle={styles.row}
ListEmptyComponent={renderItemEmpty} ListEmptyComponent={renderItemEmpty}
...@@ -152,11 +146,8 @@ const HomeView = (props) => { ...@@ -152,11 +146,8 @@ const HomeView = (props) => {
const renderItemEmpty = () => { const renderItemEmpty = () => {
return ( return (
<View style={styles.cardItemEmpty}> <View style={styles.cardItemEmpty}>
<Image <Image source={R.images.icNoData} style={{width: 50, height: 50}} />
source={R.images.icNoData} <Text style={[styles.menu_text, {color: R.colors.red}]}>
style={{ width: 50, height: 50 }}
/>
<Text style={[styles.menu_text, { color: R.colors.red }]}>
Không có d liu Không có d liu
</Text> </Text>
</View> </View>
...@@ -166,32 +157,27 @@ const HomeView = (props) => { ...@@ -166,32 +157,27 @@ const HomeView = (props) => {
return ( return (
<View style={styles.safeArea}> <View style={styles.safeArea}>
<TouchableWithoutFeedback onPress={Keyboard.dismiss} accessible={false}> <TouchableWithoutFeedback onPress={Keyboard.dismiss} accessible={false}>
<View style={styles.container_body}> <View style={styles.container_body}>
<ImageBackground <ImageBackground
source={R.images.igBackground} source={R.images.igBackground}
style={styles.background_header} style={styles.background_header}>
> <HeaderCus value={searchText} onChangeText={onSearchChange} />
<HeaderCus {cardItemInfo()}
value={searchText} </ImageBackground>
onChangeText={onSearchChange}
/> <ScrollView
{cardItemInfo()} showsVerticalScrollIndicator={false}
</ImageBackground> style={styles.scroll}
bounces={false}
<ScrollView overScrollMode="never">
showsVerticalScrollIndicator={false} {renderMenuActivity()}
style={styles.scroll} {renderMenuStatistics()}
bounces={false} {renderMenuNotification()}
overScrollMode="never" </ScrollView>
> </View>
{renderMenuActivity()}
{renderMenuStatistics()}
{renderMenuNotification()}
</ScrollView>
</View>
</TouchableWithoutFeedback> </TouchableWithoutFeedback>
</View> </View>
); );
}; };
export default HomeView; export default HomeView;
\ No newline at end of file
...@@ -88,6 +88,7 @@ const styles = StyleSheet.create({ ...@@ -88,6 +88,7 @@ const styles = StyleSheet.create({
text:{ text:{
fontSize:R.sizes.sm, fontSize:R.sizes.sm,
fontWeight:'400', fontWeight:'400',
color:R.colors.black,
fontFamily:R.fonts.fontRegular, fontFamily:R.fonts.fontRegular,
}, },
textEmpty:{ textEmpty:{
......
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