Commit 3804c1b7 by tungnq

TODO: Đã bổ sung button logic

parent 5d0804e2
......@@ -98,6 +98,65 @@ const ListWorkView = props => {
);
};
const renderReportButton = (item) => {
// Hide report button for completed, needs editing, and waiting for report status
if (item.status === 'Đã hoàn thành' || item.status === 'Cần chỉnh sửa' || item.status === 'Đợi báo cáo') {
return null;
}
// Special case for "Chờ duyệt" - show two buttons
if (item.status === 'Chờ duyệt') {
return (
<>
<Button
title="Cần chỉnh sửa"
onPress={() => {}}
backgroundColor={R.colors.orange}
textColor={R.colors.white}
fontSize={R.fontsize.fontSizeContent}
height={35}
width={100}
containerStyle={{marginRight: 10, borderRadius: 20}}
/>
<Button
title="Phê duyệt"
onPress={() => {}}
backgroundColor={R.colors.green}
textColor={R.colors.white}
fontSize={R.fontsize.fontSizeContent}
height={35}
width={100}
containerStyle={{marginRight: 10, borderRadius: 20}}
/>
</>
);
}
let buttonTitle = 'Báo cáo';
switch (item.status) {
case 'Đang thực hiện':
buttonTitle = 'Yêu cầu báo cáo';
break;
default:
buttonTitle = 'Báo cáo';
break;
}
return (
<Button
title={buttonTitle}
onPress={() => {}}
backgroundColor={R.colors.orange}
textColor={R.colors.white}
fontSize={R.fontsize.fontSizeContent}
height={35}
width={120}
containerStyle={{marginRight: 10, borderRadius: 20}}
/>
);
};
const renderListView = ( {item} ) =>{
return(
<View style={{ marginHorizontal:15, marginVertical:10}}>
......@@ -122,17 +181,7 @@ const ListWorkView = props => {
<Text style={styles.subText}>{item.document}</Text>
</Text>
<View style={{flexDirection: 'row', justifyContent: 'flex-end', marginTop:10}}>
<Button
title="Báo cáo"
onPress={() => {}}
backgroundColor={R.colors.orange}
textColor={R.colors.white}
fontSize={R.fontsize.fontSizeContent}
height={35}
width={100}
containerStyle={{marginRight: 10, borderRadius: 20}}
/>
{renderReportButton(item)}
<Button
title="Chi tiết"
onPress={() => navigation.navigate(ScreenName.DETAILWORK)}
......@@ -179,7 +228,7 @@ const ListWorkView = props => {
</View>
<View style={{flex: 0.1}}></View>
<View style={styles.boxFilter}>
<View style={{flex:1}}>
<Dropdown title={'Tìm kiếm'} height={40} />
</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