Commit 4a1607cf by tungnq

TODO: Đã xử lý logic hiển thị button chi tiết theo status

parent 7b2836db
...@@ -16,7 +16,43 @@ const ListRollCall = (props) => { ...@@ -16,7 +16,43 @@ const ListRollCall = (props) => {
dateEnd:'05/08/2025', dateEnd:'05/08/2025',
status:'Đang diễn ra' status:'Đang diễn ra'
}, },
{
id:1,
classCode:'ATTT2024.1',
generalDetails:'25',
present:'25',
lessonLearned:'18',
numberOfStudent:'40',
totalStudentFailedRollCall:'5',
dateStart:'30/06/2025',
dateEnd:'05/08/2025',
status:'Đang kết thúc'
},
{
id:1,
classCode:'ATTT2024.1',
generalDetails:'25',
present:'25',
lessonLearned:'18',
numberOfStudent:'40',
totalStudentFailedRollCall:'5',
dateStart:'30/06/2025',
dateEnd:'05/08/2025',
status:'Đang kết thúc'
},
{
id:1,
classCode:'ATTT2024.1',
generalDetails:'25',
present:'25',
lessonLearned:'18',
numberOfStudent:'40',
totalStudentFailedRollCall:'5',
dateStart:'30/06/2025',
dateEnd:'05/08/2025',
status:'Đang kết thúc'
},
]); ]);
return ( return (
<ListRollCallView dataList={dataList} /> <ListRollCallView dataList={dataList} />
......
...@@ -25,11 +25,21 @@ const ListRollCallView = props => { ...@@ -25,11 +25,21 @@ const ListRollCallView = props => {
<View style={styles.row}> <View style={styles.row}>
<Text style={styles.textTitle}> <Text style={styles.textTitle}>
Mã lp: Mã lp:
<Text style={[styles.text ,{color:R.colors.blue , fontWeight:'600', fontFamily:R.fonts.fontMedium}]}>{item.classCode}</Text> <Text
style={[
styles.text,
{
color: R.colors.blue,
fontWeight: '600',
fontFamily: R.fonts.fontMedium,
},
]}>
{item.classCode}
</Text>
</Text> </Text>
<Text style={styles.textTitle}> <Text style={styles.textTitle}>
Đã hc / Tng tiết: Đã hc / Tng tiết:
<Text style={[styles.text ,{color:R.colors.blue }]}> <Text style={[styles.text, {color: R.colors.blue}]}>
{item.lessonLearned}/{item.generalDetails} {item.lessonLearned}/{item.generalDetails}
</Text> </Text>
</Text> </Text>
...@@ -37,48 +47,72 @@ const ListRollCallView = props => { ...@@ -37,48 +47,72 @@ const ListRollCallView = props => {
<View style={styles.row}> <View style={styles.row}>
<Text style={styles.textTitle}> <Text style={styles.textTitle}>
Sĩ s:{' '} Sĩ s:{' '}
<Text style={[styles.text ,{color:R.colors.blue }]}>{item.numberOfStudent}</Text> <Text style={[styles.text, {color: R.colors.blue}]}>
{item.numberOfStudent}
</Text>
</Text> </Text>
<Text style={styles.textTitle}> <Text style={styles.textTitle}>
Tng s sv trượt đim danh:{' '} Tng s sv trượt đim danh:{' '}
<Text style={[styles.text, {color:R.colors.red }]}>{item.totalStudentFailedRollCall}</Text> <Text style={[styles.text, {color: R.colors.red}]}>
{item.totalStudentFailedRollCall}
</Text>
</Text> </Text>
</View> </View>
<Text style={styles.textTitle}> <Text style={styles.textTitle}>
Ngày bt đầu:{' '} Ngày bt đầu:{' '}
<Text style={[styles.text ,{color:R.colors.blue }]}>{item.dateStart}</Text> <Text style={[styles.text, {color: R.colors.blue}]}>
{item.dateStart}
</Text>
</Text> </Text>
<Text style={styles.textTitle}> <Text style={styles.textTitle}>
Ngày kết thúc:{' '} Ngày kết thúc:{' '}
<Text style={[styles.text ,{color:R.colors.blue }]}>{item.dateEnd}</Text> <Text style={[styles.text, {color: R.colors.blue}]}>
{item.dateEnd}
</Text>
</Text> </Text>
<View style={styles.btnContainer}> <View style={styles.btnContainer}>
{item.status === 'Đang diễn ra' && (
<Button <Button
title="Tạo QR điểm danh" title="Tạo QR điểm danh"
onPress={()=>{}} onPress={() => {}}
backgroundColor={R.colors.brown} backgroundColor={R.colors.brown}
textColor={R.colors.white} textColor={R.colors.white}
fontSize={12} fontSize={12}
containerStyle={{paddingHorizontal:5,paddingVertical:5, borderRadius:20}} containerStyle={{
paddingHorizontal: 5,
paddingVertical: 5,
borderRadius: 20,
}}
/> />
<Button )}
{item.status === 'Đang diễn ra' && (
<View style={{alignItems: 'flex-end', flex: 1}}>
<Button
title="Điểm danh" title="Điểm danh"
onPress={()=>{}} onPress={() => {}}
containerStyle={{paddingHorizontal:5, borderRadius:20}} containerStyle={{paddingHorizontal: 5,paddingVertical:5, borderRadius: 20}}
backgroundColor={R.colors.brown} backgroundColor={R.colors.brown}
textColor={R.colors.white} textColor={R.colors.white}
fontSize={12} fontSize={12}
width={85} width={85}
/> />
</View>
)}
<View style={{alignItems: 'flex-end', flex: 1}}>
<Button <Button
title="Chi tiết" title="Chi tiết"
onPress={()=>{}} onPress={() => {}}
containerStyle={{paddingHorizontal:5, borderRadius:20}} containerStyle={{
backgroundColor={R.colors.blue} paddingHorizontal: 5,
textColor={R.colors.white} borderRadius: 20,
fontSize={12} paddingVertical: 5,
width={85} }}
backgroundColor={R.colors.blue}
textColor={R.colors.white}
fontSize={12}
width={85}
/> />
</View>
</View> </View>
</View> </View>
); );
...@@ -104,9 +138,9 @@ const ListRollCallView = props => { ...@@ -104,9 +138,9 @@ const ListRollCallView = props => {
data={dataList} data={dataList}
renderItem={renderItem} renderItem={renderItem}
keyExtractor={(item, index) => `${index}`} keyExtractor={(item, index) => `${index}`}
showsVerticalScrollIndicator={false}
style={styles.list} style={styles.list}
/> />
</View> </View>
</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