Commit 9e1795b7 by tungnq

TODO: Refactor style và cải thiện tính nhất quán bố cục trên nhiều màn hình

Tăng chiều cao tối thiểu cho các tab trong TabView để cải thiện vùng chạm.

Điều chỉnh khoảng cách dọc trong style của academic advisor và compensate để bố cục thoáng hơn.

Thêm xử lý ẩn cảnh báo unique key prop trong màn hình class schedule.

Bỏ comment và bổ sung dữ liệu mẫu trong compensate index để thuận tiện cho việc test.

Chuẩn hóa khoảng cách dọc trong style của compensate list để đồng nhất.

Cải thiện cấu trúc và khả năng đọc trong compensate list view bằng cách tách riêng các phương thức render.

Cập nhật style của incoming document để đảm bảo khoảng cách nhất quán.

Tinh chỉnh style của list rest report để căn chỉnh trực quan hơn.

Nâng cấp cấu trúc list send document view để dễ đọc hơn.

Chuẩn hóa khoảng cách dọc trong style của list work để đồng bộ.

Cải thiện style của notification để có bố cục và căn chỉnh tốt hơn.

Refactor roll call view để cấu trúc rõ ràng, dễ duy trì.

Cập nhật sub teacher view để cải thiện bố cục và khả năng đọc.
parent ba3e0d42
...@@ -245,7 +245,7 @@ const styles = StyleSheet.create({ ...@@ -245,7 +245,7 @@ const styles = StyleSheet.create({
}, },
// Style cơ bản cho mỗi tab // Style cơ bản cho mỗi tab
tab: { tab: {
minHeight: 30, // Chiều cao tối thiểu 40px minHeight: 35, // Chiều cao tối thiểu 40px
justifyContent: 'center', // Căn giữa theo chiều dọc justifyContent: 'center', // Căn giữa theo chiều dọc
alignItems: 'center', // Căn giữa theo chiều ngang alignItems: 'center', // Căn giữa theo chiều ngang
position: 'relative', // Để có thể đặt activeIndicator absolute position: 'relative', // Để có thể đặt activeIndicator absolute
......
...@@ -62,7 +62,7 @@ const styles = StyleSheet.create({ ...@@ -62,7 +62,7 @@ const styles = StyleSheet.create({
shadowRadius: 1, shadowRadius: 1,
elevation: Platform.OS === 'ios' ? 1 : 2, elevation: Platform.OS === 'ios' ? 1 : 2,
marginHorizontal: 15, marginHorizontal: 15,
marginVertical: 10, marginVertical: 7.5,
}, },
containerEmpty: { containerEmpty: {
alignItems: 'center', alignItems: 'center',
......
...@@ -16,6 +16,7 @@ import * as SCREENNAME from '../../routers/ScreenNames'; ...@@ -16,6 +16,7 @@ import * as SCREENNAME from '../../routers/ScreenNames';
LogBox.ignoreLogs([ LogBox.ignoreLogs([
'[Reanimated] Reduced motion setting is enabled', '[Reanimated] Reduced motion setting is enabled',
'Each child in a list should have a unique "key" prop'
]); ]);
const ClassScheduleView = ({ const ClassScheduleView = ({
currentDate, currentDate,
......
...@@ -4,41 +4,41 @@ import CompensateView from './view'; ...@@ -4,41 +4,41 @@ import CompensateView from './view';
const Compensate = props => { const Compensate = props => {
const [dataList, setDataList] = useState([ const [dataList, setDataList] = useState([
// {id: 1, classCode: 'ATTT2024.1', rest: 5, compensate: 0, total: 25}, {id: 1, classCode: 'ATTT2024.1', rest: 5, compensate: 0, total: 25},
// {id: 2, classCode: 'ATTT2024.2', rest: 4, compensate: 1, total: 25}, {id: 2, classCode: 'ATTT2024.2', rest: 4, compensate: 1, total: 25},
// {id: 3, classCode: 'ATTT2024.3', rest: 6, compensate: 0, total: 25}, {id: 3, classCode: 'ATTT2024.3', rest: 6, compensate: 0, total: 25},
// {id: 4, classCode: 'ATTT2024.4', rest: 3, compensate: 2, total: 25}, {id: 4, classCode: 'ATTT2024.4', rest: 3, compensate: 2, total: 25},
// {id: 5, classCode: 'ATTT2024.5', rest: 5, compensate: 0, total: 25}, {id: 5, classCode: 'ATTT2024.5', rest: 5, compensate: 0, total: 25},
// {id: 6, classCode: 'CNTT2024.1', rest: 2, compensate: 1, total: 25}, {id: 6, classCode: 'CNTT2024.1', rest: 2, compensate: 1, total: 25},
// {id: 7, classCode: 'CNTT2024.2', rest: 4, compensate: 0, total: 25}, {id: 7, classCode: 'CNTT2024.2', rest: 4, compensate: 0, total: 25},
// {id: 8, classCode: 'CNTT2024.3', rest: 5, compensate: 0, total: 25}, {id: 8, classCode: 'CNTT2024.3', rest: 5, compensate: 0, total: 25},
// {id: 9, classCode: 'CNTT2024.4', rest: 3, compensate: 1, total: 25}, {id: 9, classCode: 'CNTT2024.4', rest: 3, compensate: 1, total: 25},
// {id: 10, classCode: 'CNTT2024.5', rest: 6, compensate: 0, total: 25}, {id: 10, classCode: 'CNTT2024.5', rest: 6, compensate: 0, total: 25},
// {id: 11, classCode: 'KTPM2024.1', rest: 4, compensate: 1, total: 25}, {id: 11, classCode: 'KTPM2024.1', rest: 4, compensate: 1, total: 25},
// {id: 12, classCode: 'KTPM2024.2', rest: 2, compensate: 2, total: 25}, {id: 12, classCode: 'KTPM2024.2', rest: 2, compensate: 2, total: 25},
// {id: 13, classCode: 'KTPM2024.3', rest: 5, compensate: 0, total: 25}, {id: 13, classCode: 'KTPM2024.3', rest: 5, compensate: 0, total: 25},
// {id: 14, classCode: 'KTPM2024.4', rest: 4, compensate: 0, total: 25}, {id: 14, classCode: 'KTPM2024.4', rest: 4, compensate: 0, total: 25},
// {id: 15, classCode: 'KTPM2024.5', rest: 3, compensate: 1, total: 25}, {id: 15, classCode: 'KTPM2024.5', rest: 3, compensate: 1, total: 25},
// {id: 16, classCode: 'HTTT2024.1', rest: 5, compensate: 0, total: 25}, {id: 16, classCode: 'HTTT2024.1', rest: 5, compensate: 0, total: 25},
// {id: 17, classCode: 'HTTT2024.2', rest: 6, compensate: 0, total: 25}, {id: 17, classCode: 'HTTT2024.2', rest: 6, compensate: 0, total: 25},
// {id: 18, classCode: 'HTTT2024.3', rest: 3, compensate: 2, total: 25}, {id: 18, classCode: 'HTTT2024.3', rest: 3, compensate: 2, total: 25},
// {id: 19, classCode: 'HTTT2024.4', rest: 4, compensate: 1, total: 25}, {id: 19, classCode: 'HTTT2024.4', rest: 4, compensate: 1, total: 25},
// {id: 20, classCode: 'HTTT2024.5', rest: 5, compensate: 0, total: 25}, {id: 20, classCode: 'HTTT2024.5', rest: 5, compensate: 0, total: 25},
// {id: 21, classCode: 'KHMT2024.1', rest: 4, compensate: 0, total: 25}, {id: 21, classCode: 'KHMT2024.1', rest: 4, compensate: 0, total: 25},
// {id: 22, classCode: 'KHMT2024.2', rest: 5, compensate: 1, total: 25}, {id: 22, classCode: 'KHMT2024.2', rest: 5, compensate: 1, total: 25},
// {id: 23, classCode: 'KHMT2024.3', rest: 6, compensate: 0, total: 25}, {id: 23, classCode: 'KHMT2024.3', rest: 6, compensate: 0, total: 25},
// {id: 24, classCode: 'KHMT2024.4', rest: 3, compensate: 1, total: 25}, {id: 24, classCode: 'KHMT2024.4', rest: 3, compensate: 1, total: 25},
// {id: 25, classCode: 'KHMT2024.5', rest: 5, compensate: 0, total: 25}, {id: 25, classCode: 'KHMT2024.5', rest: 5, compensate: 0, total: 25},
// {id: 26, classCode: 'MMT2024.1', rest: 4, compensate: 1, total: 25}, {id: 26, classCode: 'MMT2024.1', rest: 4, compensate: 1, total: 25},
// {id: 27, classCode: 'MMT2024.2', rest: 2, compensate: 0, total: 25}, {id: 27, classCode: 'MMT2024.2', rest: 2, compensate: 0, total: 25},
// {id: 28, classCode: 'MMT2024.3', rest: 5, compensate: 0, total: 25}, {id: 28, classCode: 'MMT2024.3', rest: 5, compensate: 0, total: 25},
// {id: 29, classCode: 'MMT2024.4', rest: 3, compensate: 2, total: 25}, {id: 29, classCode: 'MMT2024.4', rest: 3, compensate: 2, total: 25},
// {id: 30, classCode: 'MMT2024.5', rest: 6, compensate: 0, total: 25}, {id: 30, classCode: 'MMT2024.5', rest: 6, compensate: 0, total: 25},
]); ]);
return <CompensateView dataList={dataList} />; return <CompensateView dataList={dataList} />;
}; };
......
...@@ -19,7 +19,7 @@ const styles = StyleSheet.create({ ...@@ -19,7 +19,7 @@ const styles = StyleSheet.create({
card: { card: {
borderRadius: 10, borderRadius: 10,
marginVertical: 10, marginVertical: 7.5,
backgroundColor: R.colors.white, backgroundColor: R.colors.white,
shadowColor: R.colors.black, shadowColor: R.colors.black,
shadowOffset: {width: 0, height: 2}, shadowOffset: {width: 0, height: 2},
......
...@@ -200,11 +200,9 @@ const DetailCompensateView = props => { ...@@ -200,11 +200,9 @@ const DetailCompensateView = props => {
); );
}; };
const renderHeaderBody = () =>{
return ( return (
<View style={styles.container}> <View style={{alignItems: 'center', marginTop:10}}>
<Header title={'ATTT2024.1'} isBack />
<View style={styles.body}>
<View style={{alignItems: 'center', marginTop: 10}}>
<Text <Text
style={[ style={[
styles.text, styles.text,
...@@ -228,6 +226,11 @@ const DetailCompensateView = props => { ...@@ -228,6 +226,11 @@ const DetailCompensateView = props => {
{itemDetail?.rest} / {itemDetail?.compensate} / {itemDetail?.total} {itemDetail?.rest} / {itemDetail?.compensate} / {itemDetail?.total}
</Text> </Text>
</View> </View>
)
}
const renderList = () =>{
return (
<FlatList <FlatList
data={listData || []} data={listData || []}
renderItem={renderItem} renderItem={renderItem}
...@@ -235,6 +238,15 @@ const DetailCompensateView = props => { ...@@ -235,6 +238,15 @@ const DetailCompensateView = props => {
vertical vertical
keyExtractor={(item, index) => `${index}`} keyExtractor={(item, index) => `${index}`}
/> />
)
}
return (
<View style={styles.container}>
<Header title={'ATTT2024.1'} isBack />
<View style={styles.body}>
{renderHeaderBody()}
{renderList()}
</View> </View>
</View> </View>
); );
......
...@@ -13,8 +13,7 @@ const styles = StyleSheet.create({ ...@@ -13,8 +13,7 @@ const styles = StyleSheet.create({
card: { card: {
borderRadius: 10, borderRadius: 10,
padding: 5, padding: 5,
marginTop: 10, marginVertical:10,
marginBottom: 10,
marginHorizontal: 15, marginHorizontal: 15,
alignItems: 'center', alignItems: 'center',
justifyContent: 'center', justifyContent: 'center',
...@@ -44,7 +43,7 @@ const styles = StyleSheet.create({ ...@@ -44,7 +43,7 @@ const styles = StyleSheet.create({
containerCard: { containerCard: {
padding: 10, padding: 10,
borderRadius: 10, borderRadius: 10,
marginVertical: 10, marginVertical: 7.5,
backgroundColor: R.colors.white, backgroundColor: R.colors.white,
shadowColor: R.colors.black, shadowColor: R.colors.black,
shadowOffset: {width: 0, height: 2}, shadowOffset: {width: 0, height: 2},
......
...@@ -82,8 +82,6 @@ const CompensateView = props => { ...@@ -82,8 +82,6 @@ const CompensateView = props => {
vertical vertical
keyExtractor={(item, index) => `${index}`} keyExtractor={(item, index) => `${index}`}
/> />
); );
}; };
...@@ -119,8 +117,8 @@ const CompensateView = props => { ...@@ -119,8 +117,8 @@ const CompensateView = props => {
); );
}; };
const renderListEmpty = () =>{ const renderListEmpty = () => {
return( return (
<View style={styles.containerEmpty}> <View style={styles.containerEmpty}>
<View> <View>
<Image <Image
...@@ -134,12 +132,12 @@ const CompensateView = props => { ...@@ -134,12 +132,12 @@ const CompensateView = props => {
Không có d liu Không có d liu
</Text> </Text>
</View> </View>
) );
}; };
const renderBody = () => { const renderBody = () => {
return ( return (
<View style={styles.body }> <View style={styles.body}>
{renderHeaderBody()} {renderHeaderBody()}
<View style={styles.containerList}> <View style={styles.containerList}>
{dataList.length > 0 ? renderListClass() : renderListEmpty()} {dataList.length > 0 ? renderListClass() : renderListEmpty()}
......
...@@ -13,8 +13,7 @@ const styles = StyleSheet.create({ ...@@ -13,8 +13,7 @@ const styles = StyleSheet.create({
card: { card: {
borderRadius: 10, borderRadius: 10,
padding: 5, padding: 5,
marginTop: 15, marginVertical:10,
marginBottom: 5,
marginHorizontal: 15, marginHorizontal: 15,
alignItems: 'center', alignItems: 'center',
justifyContent: 'center', justifyContent: 'center',
...@@ -44,7 +43,7 @@ const styles = StyleSheet.create({ ...@@ -44,7 +43,7 @@ const styles = StyleSheet.create({
containerCard: { containerCard: {
padding: 10, padding: 10,
borderRadius: 10, borderRadius: 10,
marginVertical: 10, marginVertical: 7.5,
backgroundColor: R.colors.white, backgroundColor: R.colors.white,
shadowColor: R.colors.black, shadowColor: R.colors.black,
shadowOffset: {width: 0, height: 2}, shadowOffset: {width: 0, height: 2},
......
...@@ -41,6 +41,7 @@ const IncomingDocument = props => { ...@@ -41,6 +41,7 @@ const IncomingDocument = props => {
number_entry_book: '12493-fh544', number_entry_book: '12493-fh544',
status: 'Công khai', status: 'Công khai',
}, },
]); ]);
const [searchQuery, setSearchQuery] = useState(''); const [searchQuery, setSearchQuery] = useState('');
......
...@@ -41,8 +41,8 @@ const styles = StyleSheet.create({ ...@@ -41,8 +41,8 @@ const styles = StyleSheet.create({
borderColor: R.colors.grayBorderInputTextHeader, borderColor: R.colors.grayBorderInputTextHeader,
borderRadius: 10, borderRadius: 10,
padding: 5, padding: 5,
marginTop: 15, marginTop: 10,
marginBottom: 15, marginBottom: 10,
marginHorizontal: 15, marginHorizontal: 15,
alignItems: 'center', alignItems: 'center',
justifyContent: 'center', justifyContent: 'center',
......
...@@ -13,8 +13,7 @@ const styles = StyleSheet.create({ ...@@ -13,8 +13,7 @@ const styles = StyleSheet.create({
card: { card: {
borderRadius: 10, borderRadius: 10,
padding: 5, padding: 5,
marginTop: 15, marginVertical:10,
marginBottom: 5,
marginHorizontal: 15, marginHorizontal: 15,
alignItems: 'center', alignItems: 'center',
justifyContent: 'center', justifyContent: 'center',
...@@ -43,7 +42,7 @@ const styles = StyleSheet.create({ ...@@ -43,7 +42,7 @@ const styles = StyleSheet.create({
containerCard: { containerCard: {
padding: 10, padding: 10,
borderRadius: 10, borderRadius: 10,
marginVertical: 10, marginVertical: 7.5,
backgroundColor: R.colors.white, backgroundColor: R.colors.white,
shadowColor: R.colors.black, shadowColor: R.colors.black,
shadowOffset: {width: 0, height: 2}, shadowOffset: {width: 0, height: 2},
......
...@@ -55,10 +55,8 @@ const ListRestReportView = props => { ...@@ -55,10 +55,8 @@ const ListRestReportView = props => {
); );
}; };
const renderCard = () => {
return ( return (
<View style={styles.container}>
<Header title={'Báo nghỉ lịch dạy'} isBack />
<View style={styles.body}>
<View style={styles.card}> <View style={styles.card}>
<TouchableOpacity style={styles.btnCard}> <TouchableOpacity style={styles.btnCard}>
<Text <Text
...@@ -74,6 +72,11 @@ const ListRestReportView = props => { ...@@ -74,6 +72,11 @@ const ListRestReportView = props => {
</Text> </Text>
</TouchableOpacity> </TouchableOpacity>
</View> </View>
);
};
const renderList = () => {
return (
<FlatList <FlatList
data={dataList || []} data={dataList || []}
renderItem={renderItem} renderItem={renderItem}
...@@ -81,6 +84,11 @@ const ListRestReportView = props => { ...@@ -81,6 +84,11 @@ const ListRestReportView = props => {
vertical vertical
keyExtractor={(item, index) => `${index}`} keyExtractor={(item, index) => `${index}`}
/> />
);
};
const renderButton = () => {
return (
<TouchableOpacity <TouchableOpacity
style={styles.btnRegister} style={styles.btnRegister}
onPress={() => navigation.navigate(ScreenName.REGISTERABSENCE)}> onPress={() => navigation.navigate(ScreenName.REGISTERABSENCE)}>
...@@ -88,7 +96,23 @@ const ListRestReportView = props => { ...@@ -88,7 +96,23 @@ const ListRestReportView = props => {
Đăng kí báo ngh Đăng kí báo ngh
</Text> </Text>
</TouchableOpacity> </TouchableOpacity>
);
};
const renderBody = () => {
return (
<View style={styles.body}>
{renderCard()}
{renderList()}
{renderButton()}
</View> </View>
);
};
return (
<View style={styles.container}>
<Header title={'Báo nghỉ lịch dạy'} isBack />
{renderBody()}
</View> </View>
); );
}; };
......
...@@ -13,7 +13,7 @@ const styles = StyleSheet.create({ ...@@ -13,7 +13,7 @@ const styles = StyleSheet.create({
cardTabView: {}, cardTabView: {},
itemTabView: { itemTabView: {
width: 103, width: 103,
height: 30, height: 35,
borderRadius: 10, borderRadius: 10,
marginTop: 10, marginTop: 10,
backgroundColor: R.colors.gray, backgroundColor: R.colors.gray,
...@@ -40,8 +40,7 @@ const styles = StyleSheet.create({ ...@@ -40,8 +40,7 @@ const styles = StyleSheet.create({
borderColor: R.colors.grayBorderInputTextHeader, borderColor: R.colors.grayBorderInputTextHeader,
borderRadius: 10, borderRadius: 10,
padding: 5, padding: 5,
marginTop: 15, marginVertical:10,
marginBottom: 15,
marginHorizontal: 15, marginHorizontal: 15,
alignItems: 'center', alignItems: 'center',
justifyContent: 'center', justifyContent: 'center',
...@@ -91,7 +90,7 @@ const styles = StyleSheet.create({ ...@@ -91,7 +90,7 @@ const styles = StyleSheet.create({
borderRadius: 10, borderRadius: 10,
padding: 10, padding: 10,
marginHorizontal: 15, marginHorizontal: 15,
marginVertical: 7.5, marginVertical:7.5,
backgroundColor: R.colors.white, backgroundColor: R.colors.white,
shadowColor: R.colors.black, shadowColor: R.colors.black,
shadowOffset: {width: 0.5, height: 2}, shadowOffset: {width: 0.5, height: 2},
......
...@@ -180,11 +180,9 @@ const ListSendView = props => { ...@@ -180,11 +180,9 @@ const ListSendView = props => {
/> />
); );
}; };
const renderListView = () => {
return ( return (
<View style={styles.container}>
<Header title={'Danh sách văn bản đi'} isBack />
<View style={{flex: 1}}>
<View style={styles.body}>
<View style={styles.cardTabView}> <View style={styles.cardTabView}>
<FlatList <FlatList
data={dataListTabView} data={dataListTabView}
...@@ -195,31 +193,26 @@ const ListSendView = props => { ...@@ -195,31 +193,26 @@ const ListSendView = props => {
showsHorizontalScrollIndicator={false} showsHorizontalScrollIndicator={false}
/> />
</View> </View>
);
};
<View style={{marginBottom: 15}}> const renderBody = () => {
<View style={styles.card}> return (
<TouchableOpacity style={styles.btnCard}> <View style={styles.body}>
<Text {renderListView()}
style={[
styles.text, {renderCard()}
{
fontSize: R.fontsize.fontSizeContent, {renderListIncomingDocument()}
fontWeight: '600',
fontFamily: R.fonts.fontMedium,
color: R.colors.black,
},
]}>
Hc k 2, Năm 2025
</Text>
</TouchableOpacity>
</View> </View>
);
};
const renderFilter = () =>{
return (
<View style={styles.box_3}> <View style={styles.box_3}>
<View style={styles.searchBox}> <View style={styles.searchBox}>
<Image <Image source={R.images.icSearch} style={{width: 20, height: 20}} />
source={R.images.icSearch}
style={{width: 20, height: 20}}
/>
<View style={{flex: 1}}> <View style={{flex: 1}}>
<TextInput <TextInput
placeholder="Tìm kiếm" placeholder="Tìm kiếm"
...@@ -235,10 +228,37 @@ const ListSendView = props => { ...@@ -235,10 +228,37 @@ const ListSendView = props => {
<Dropdown title={'Tìm kiếm'} height={35} /> <Dropdown title={'Tìm kiếm'} height={35} />
</View> </View>
</View> </View>
</View> )
}
{renderListIncomingDocument()} const renderCard = () => {
return (
<View >
<View style={styles.card}>
<TouchableOpacity style={styles.btnCard}>
<Text
style={[
styles.text,
{
fontSize: R.fontsize.fontSizeContent,
fontWeight: '600',
fontFamily: R.fonts.fontMedium,
color: R.colors.black,
},
]}>
Hc k 2, Năm 2025
</Text>
</TouchableOpacity>
</View> </View>
{renderFilter()}
</View>
);
};
return (
<View style={styles.container}>
<Header title={'Danh sách văn bản đi'} isBack />
<View style={{flex: 1}}>
{renderBody()}
<View style={{marginHorizontal: 15}}> <View style={{marginHorizontal: 15}}>
<FAB> <FAB>
......
...@@ -15,8 +15,8 @@ const styles = StyleSheet.create({ ...@@ -15,8 +15,8 @@ const styles = StyleSheet.create({
borderColor: R.colors.grayBorderInputTextHeader, borderColor: R.colors.grayBorderInputTextHeader,
borderRadius: 10, borderRadius: 10,
padding: 5, padding: 5,
marginTop: 15, marginTop: 10,
marginBottom: 15, marginBottom: 10,
marginHorizontal: 15, marginHorizontal: 15,
alignItems: 'center', alignItems: 'center',
justifyContent: 'center', justifyContent: 'center',
...@@ -38,7 +38,7 @@ const styles = StyleSheet.create({ ...@@ -38,7 +38,7 @@ const styles = StyleSheet.create({
borderColor: R.colors.grayBorderInputTextHeader, borderColor: R.colors.grayBorderInputTextHeader,
}, },
container_tab_view: { container_tab_view: {
marginVertical: 5, marginTop:10
}, },
item_tab_view: { item_tab_view: {
backgroundColor: R.colors.gray, backgroundColor: R.colors.gray,
...@@ -72,11 +72,12 @@ const styles = StyleSheet.create({ ...@@ -72,11 +72,12 @@ const styles = StyleSheet.create({
justifyContent: 'flex-start', justifyContent: 'flex-start',
paddingLeft: 15, paddingLeft: 15,
flexDirection: 'row', flexDirection: 'row',
height: 30, height: 35,
}, },
box_3: { box_3: {
flexDirection: 'row', flexDirection: 'row',
marginHorizontal: 15, marginHorizontal: 15,
marginBottom:10,
alignItems: 'center', alignItems: 'center',
}, },
containerCard: { containerCard: {
...@@ -102,6 +103,63 @@ const styles = StyleSheet.create({ ...@@ -102,6 +103,63 @@ const styles = StyleSheet.create({
fontWeight: '400', fontWeight: '400',
color: R.colors.black, color: R.colors.black,
}, },
// New styles moved from inline styles
listItemContainer: {
marginHorizontal: 15,
marginBottom:10
},
statusHeader: {
borderTopLeftRadius: 15,
borderTopRightRadius: 15,
},
statusText: {
marginHorizontal: 15,
fontFamily: R.fonts.fontMedium,
fontWeight: '600',
color: R.colors.white,
},
cardContent: {
paddingHorizontal: 15,
paddingTop: 10,
},
rowSpaceBetween: {
flexDirection: 'row',
justifyContent: 'space-between',
},
actionButtonsContainer: {
flexDirection: 'row',
justifyContent: 'flex-end',
marginTop: 10,
},
buttonContainerStyle: {
marginRight: 10,
borderRadius: 20,
},
searchIcon: {
width: 20,
height: 20,
},
searchInputContainer: {
flex: 1,
padding: 0,
margin: 0,
height: 35,
},
searchInput: {
height: 35,
padding: 0,
marginRight: 15,
},
filterSpacer: {
flex: 0.1,
},
dropdownContainer: {
flex: 1,
},
listContainer: {
marginBottom: 15,
flex: 1,
},
}); });
export default styles; export default styles;
...@@ -49,7 +49,7 @@ const ListWorkView = props => { ...@@ -49,7 +49,7 @@ const ListWorkView = props => {
tabStyle={styles.item_tab_view} tabStyle={styles.item_tab_view}
style={styles.container_tab_view} style={styles.container_tab_view}
mode="filter" mode="filter"
defaultActiveKey="all" defaultActiveKey={ROLE.ALL}
scrollable={true} scrollable={true}
activeTabStyle={styles.active_tab_view} activeTabStyle={styles.active_tab_view}
textStyle={styles.text_tab_view} textStyle={styles.text_tab_view}
...@@ -78,7 +78,7 @@ const ListWorkView = props => { ...@@ -78,7 +78,7 @@ const ListWorkView = props => {
fontSize={11} fontSize={11}
height={30} height={30}
width={100} width={100}
containerStyle={{marginRight: 10, borderRadius: 20}} containerStyle={styles.buttonContainerStyle}
/> />
)); ));
}; };
...@@ -86,33 +86,22 @@ const ListWorkView = props => { ...@@ -86,33 +86,22 @@ const ListWorkView = props => {
const renderListView = ({item}) => { const renderListView = ({item}) => {
return ( return (
<TouchableOpacity <TouchableOpacity
style={{marginHorizontal: 15, marginVertical: 10}} style={styles.listItemContainer}
onPress={() => onViewDetailDeliverToMe(item)} onPress={() => onViewDetailDeliverToMe(item)}
activeOpacity={0.7}> activeOpacity={0.7}>
<View <View
style={{
backgroundColor: getStatusColor(item.status),
borderTopLeftRadius: 15,
borderTopRightRadius: 15,
}}>
<Text
style={[ style={[
styles.subText, styles.statusHeader,
{ {backgroundColor: getStatusColor(item.status)},
marginHorizontal: 15,
fontFamily: R.fonts.fontMedium,
fontWeight: '600',
color: R.colors.white,
},
]}> ]}>
<Text style={[styles.subText, styles.statusText]}>
{item.status} {item.status}
</Text> </Text>
</View> </View>
<View style={styles.containerCard}> <View style={styles.containerCard}>
<View style={{paddingHorizontal: 15, paddingTop: 10}}> <View style={styles.cardContent}>
<Text style={styles.text}>{item.title}</Text> <Text style={styles.text}>{item.title}</Text>
<View <View style={styles.rowSpaceBetween}>
style={{flexDirection: 'row', justifyContent: 'space-between'}}>
<Text style={styles.text}> <Text style={styles.text}>
Ngày đến hn: Ngày đến hn:
<Text style={styles.subText}>{item.deadline}</Text> <Text style={styles.subText}>{item.deadline}</Text>
...@@ -130,12 +119,7 @@ const ListWorkView = props => { ...@@ -130,12 +119,7 @@ const ListWorkView = props => {
</Text> </Text>
</View> </View>
<View <View style={styles.actionButtonsContainer}>
style={{
flexDirection: 'row',
justifyContent: 'flex-end',
marginTop: 10,
}}>
{renderActionButtons(item)} {renderActionButtons(item)}
</View> </View>
</View> </View>
...@@ -157,20 +141,20 @@ const ListWorkView = props => { ...@@ -157,20 +141,20 @@ const ListWorkView = props => {
return ( return (
<View style={styles.box_3}> <View style={styles.box_3}>
<View style={styles.searchBox}> <View style={styles.searchBox}>
<Image source={R.images.icSearch} style={{width: 20, height: 20}} /> <Image source={R.images.icSearch} style={styles.searchIcon} />
<View style={{flex: 1, padding: 0, margin: 0, height: 30}}> <View style={styles.searchInputContainer}>
<TextInput <TextInput
placeholder="Tìm kiếm" placeholder="Tìm kiếm"
style={[styles.text, {height: 30, padding: 0, marginRight: 15}]} style={[styles.text, styles.searchInput]}
value={searchQuery} value={searchQuery}
onChangeText={setSearchQuery} onChangeText={setSearchQuery}
/> />
</View> </View>
</View> </View>
<View style={{flex: 0.1}}></View> <View style={styles.filterSpacer}></View>
<View style={{flex: 1}}> <View style={styles.dropdownContainer}>
<Dropdown title={'Tìm kiếm'} height={30} /> <Dropdown title={'Tìm kiếm'} height={35} />
</View> </View>
</View> </View>
); );
...@@ -191,7 +175,7 @@ const ListWorkView = props => { ...@@ -191,7 +175,7 @@ const ListWorkView = props => {
<View style={styles.body}> <View style={styles.body}>
{renderTabView()} {renderTabView()}
{renderCard()} {renderCard()}
<View style={{marginBottom: 15, flex: 1}}> <View style={styles.listContainer}>
{renderFilter()} {renderFilter()}
{renderListItem()} {renderListItem()}
</View> </View>
......
...@@ -12,6 +12,7 @@ const styles = StyleSheet.create({ ...@@ -12,6 +12,7 @@ const styles = StyleSheet.create({
minWidth: Platform.OS === 'ios' ? 70 : 80, minWidth: Platform.OS === 'ios' ? 70 : 80,
backgroundColor: R.colors.grayButton, backgroundColor: R.colors.grayButton,
borderRadius: 10, borderRadius: 10,
height:35,
marginRight: Platform.OS === 'ios' ? 23 : 15, marginRight: Platform.OS === 'ios' ? 23 : 15,
alignItems: 'center', alignItems: 'center',
justifyContent: 'center', justifyContent: 'center',
...@@ -25,7 +26,7 @@ const styles = StyleSheet.create({ ...@@ -25,7 +26,7 @@ const styles = StyleSheet.create({
alignItems: 'center', alignItems: 'center',
justifyContent: 'center', justifyContent: 'center',
marginHorizontal: 15, marginHorizontal: 15,
marginVertical: 15, marginVertical: 10,
}, },
textTabView: { textTabView: {
color: R.colors.white, color: R.colors.white,
...@@ -43,6 +44,7 @@ const styles = StyleSheet.create({ ...@@ -43,6 +44,7 @@ const styles = StyleSheet.create({
borderWidth: 1, borderWidth: 1,
borderRadius: 100, borderRadius: 100,
marginHorizontal: 15, marginHorizontal: 15,
marginBottom:10,
backgroundColor: R.colors.white, backgroundColor: R.colors.white,
flexDirection: 'row', flexDirection: 'row',
height: 35, height: 35,
...@@ -75,6 +77,7 @@ const styles = StyleSheet.create({ ...@@ -75,6 +77,7 @@ const styles = StyleSheet.create({
cardItem: { cardItem: {
paddingVertical: 5, paddingVertical: 5,
paddingHorizontal: 15, paddingHorizontal: 15,
marginVertical:7.5,
borderColor: R.colors.grayBorderInputTextHeader, borderColor: R.colors.grayBorderInputTextHeader,
borderRadius: 10, borderRadius: 10,
backgroundColor: R.colors.white, backgroundColor: R.colors.white,
...@@ -84,7 +87,6 @@ const styles = StyleSheet.create({ ...@@ -84,7 +87,6 @@ const styles = StyleSheet.create({
shadowOpacity: Platform.OS === 'ios' ? 0.25 : 1, shadowOpacity: Platform.OS === 'ios' ? 0.25 : 1,
shadowRadius: 2, shadowRadius: 2,
elevation: Platform.OS === 'ios' ? 1 : 2, elevation: Platform.OS === 'ios' ? 1 : 2,
marginBottom: 15,
}, },
cardItemTution: { cardItemTution: {
flexDirection: 'row', flexDirection: 'row',
......
...@@ -190,7 +190,6 @@ const NotificationView = props => { ...@@ -190,7 +190,6 @@ const NotificationView = props => {
renderItem={getRenderItemFunction()} renderItem={getRenderItemFunction()}
keyExtractor={(item, index) => `${activeTab}-${index}`} keyExtractor={(item, index) => `${activeTab}-${index}`}
showsVerticalScrollIndicator={false} showsVerticalScrollIndicator={false}
contentContainerStyle={styles.containerListNotification}
vertical vertical
/> />
); );
...@@ -204,6 +203,17 @@ const NotificationView = props => { ...@@ -204,6 +203,17 @@ const NotificationView = props => {
</View> </View>
); );
}; };
const renderList = () =>{
return (
<View style={styles.containerBody}>
{/* {(dataNotifi[activeTab] && dataNotifi[activeTab].length > 0) && renderSearchBox()} */}
{dataNotifi[activeTab].length === 0
? renderItemEmpty()
: renderListNotification()}
</View>
)
}
return ( return (
<View style={styles.safeArea}> <View style={styles.safeArea}>
<Header title={'Thông báo'} /> <Header title={'Thông báo'} />
...@@ -214,13 +224,8 @@ const NotificationView = props => { ...@@ -214,13 +224,8 @@ const NotificationView = props => {
{renderSearchBox()} {renderSearchBox()}
</View> </View>
<View style={styles.containerBody}> {renderList()}
{/* {(dataNotifi[activeTab] && dataNotifi[activeTab].length > 0) && renderSearchBox()} */}
{dataNotifi[activeTab].length === 0
? renderItemEmpty()
: renderListNotification()}
</View>
<View style={styles.containerFooter}> <View style={styles.containerFooter}>
<TouchableOpacity <TouchableOpacity
style={styles.btnFooter} style={styles.btnFooter}
......
...@@ -16,8 +16,7 @@ const styles = StyleSheet.create({ ...@@ -16,8 +16,7 @@ const styles = StyleSheet.create({
borderColor: R.colors.grayBorderInputTextHeader, borderColor: R.colors.grayBorderInputTextHeader,
borderRadius: 10, borderRadius: 10,
padding: 5, padding: 5,
marginTop: 15, marginVertical:10,
marginBottom: 15,
alignItems: 'center', alignItems: 'center',
justifyContent: 'center', justifyContent: 'center',
backgroundColor: R.colors.white, backgroundColor: R.colors.white,
...@@ -50,8 +49,8 @@ const styles = StyleSheet.create({ ...@@ -50,8 +49,8 @@ const styles = StyleSheet.create({
borderWidth: 1, borderWidth: 1,
borderRadius: 100, borderRadius: 100,
paddingHorizontal: 10, paddingHorizontal: 10,
paddingVertical: 5,
marginHorizontal: 15, marginHorizontal: 15,
marginBottom:10,
}, },
textInput: { textInput: {
fontSize: R.sizes.sm, fontSize: R.sizes.sm,
...@@ -61,7 +60,7 @@ const styles = StyleSheet.create({ ...@@ -61,7 +60,7 @@ const styles = StyleSheet.create({
padding: 0, padding: 0,
margin: 0, margin: 0,
flex: 1, flex: 1,
height: 25, height: 35,
}, },
iconSearch: { iconSearch: {
width: 24, width: 24,
...@@ -72,8 +71,7 @@ const styles = StyleSheet.create({ ...@@ -72,8 +71,7 @@ const styles = StyleSheet.create({
paddingVertical: 10, paddingVertical: 10,
paddingHorizontal: 15, paddingHorizontal: 15,
marginHorizontal: 15, marginHorizontal: 15,
marginTop: 10, marginVertical:7.5,
marginBottom: 15,
backgroundColor: R.colors.white, backgroundColor: R.colors.white,
borderRadius: 15, borderRadius: 15,
shadowColor: R.colors.black, shadowColor: R.colors.black,
......
...@@ -19,7 +19,6 @@ const ListRollCallView = props => { ...@@ -19,7 +19,6 @@ const ListRollCallView = props => {
const {dataList} = props; const {dataList} = props;
const navigation = useNavigation(); const navigation = useNavigation();
const renderItem = ({item}) => { const renderItem = ({item}) => {
console.log(item);
return ( return (
<View style={styles.item}> <View style={styles.item}>
<View style={styles.row}> <View style={styles.row}>
...@@ -125,10 +124,9 @@ const ListRollCallView = props => { ...@@ -125,10 +124,9 @@ const ListRollCallView = props => {
</View> </View>
); );
}; };
const renderCard = () => {
return ( return (
<View style={styles.container}>
<Header title={'Danh sách lớp điểm danh'} isBack />
<View style={styles.body}>
<View style={styles.card}> <View style={styles.card}>
<TouchableOpacity style={styles.btnCard}> <TouchableOpacity style={styles.btnCard}>
<Text <Text
...@@ -144,6 +142,11 @@ const ListRollCallView = props => { ...@@ -144,6 +142,11 @@ const ListRollCallView = props => {
</Text> </Text>
</TouchableOpacity> </TouchableOpacity>
</View> </View>
);
};
const renderFilter = () => {
return (
<View style={styles.searchContainer}> <View style={styles.searchContainer}>
<Image source={R.images.icSearch} style={styles.iconSearch} /> <Image source={R.images.icSearch} style={styles.iconSearch} />
<TextInput <TextInput
...@@ -152,14 +155,32 @@ const ListRollCallView = props => { ...@@ -152,14 +155,32 @@ const ListRollCallView = props => {
style={styles.textInput} style={styles.textInput}
/> />
</View> </View>
);
};
const renderListView = () => {
return (
<FlatList <FlatList
data={dataList} data={dataList}
renderItem={renderItem} renderItem={renderItem}
keyExtractor={(item, index) => `${index}`} keyExtractor={(item, index) => `${index}`}
showsVerticalScrollIndicator={false} showsVerticalScrollIndicator={false}
style={styles.list}
/> />
);
};
const renderBody = () => {
return (
<View style={styles.body}>
{renderCard()}
{renderFilter()}
{renderListView()}
</View> </View>
);
};
return (
<View style={styles.container}>
<Header title={'Danh sách lớp điểm danh'} isBack />
{renderBody()}
</View> </View>
); );
}; };
......
...@@ -12,8 +12,7 @@ const styles = StyleSheet.create({ ...@@ -12,8 +12,7 @@ const styles = StyleSheet.create({
card: { card: {
borderRadius: 10, borderRadius: 10,
padding: 5, padding: 5,
marginTop: 15, marginVertical:10,
marginBottom: 15,
marginHorizontal: 15, marginHorizontal: 15,
alignItems: 'center', alignItems: 'center',
justifyContent: 'center', justifyContent: 'center',
...@@ -43,7 +42,7 @@ const styles = StyleSheet.create({ ...@@ -43,7 +42,7 @@ const styles = StyleSheet.create({
containerCard: { containerCard: {
padding: 10, padding: 10,
borderRadius: 10, borderRadius: 10,
marginBottom: 15, marginVertical:7.5,
backgroundColor: R.colors.white, backgroundColor: R.colors.white,
shadowColor: R.colors.black, shadowColor: R.colors.black,
shadowOffset: {width: 0, height: 2}, shadowOffset: {width: 0, height: 2},
......
...@@ -179,10 +179,9 @@ const SubTeacherView = props => { ...@@ -179,10 +179,9 @@ const SubTeacherView = props => {
return R.colors.orange; return R.colors.orange;
} }
}; };
const renderCard = () => {
return ( return (
<View style={styles.container}>
<Header title={'Xác nhận dạy thay'} isBack />
<View style={styles.body}>
<View style={styles.card}> <View style={styles.card}>
<TouchableOpacity style={styles.btnCard}> <TouchableOpacity style={styles.btnCard}>
<Text <Text
...@@ -198,15 +197,33 @@ const SubTeacherView = props => { ...@@ -198,15 +197,33 @@ const SubTeacherView = props => {
</Text> </Text>
</TouchableOpacity> </TouchableOpacity>
</View> </View>
);
};
const renderList = () => {
return (
<FlatList <FlatList
data={dataList || []} data={dataList || []}
renderItem={renderItem} renderItem={renderItem}
showsVerticalScrollIndicator={false} showsVerticalScrollIndicator={false}
vertical vertical
contentContainerStyle={{paddingTop: 10}}
keyExtractor={(item, index) => `${index}`} keyExtractor={(item, index) => `${index}`}
/> />
);
};
const renderBody = () =>{
return (
<View style={styles.body}>
{renderCard()}
{renderList()}
</View> </View>
)
}
return (
<View style={styles.container}>
<Header title={'Xác nhận dạy thay'} isBack />
{renderBody()}
</View> </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