Commit 1fc5f40c by tungnq

TODO: Tái cấu trúc các componet và style trong modal list work

parent cbd22b47
......@@ -207,9 +207,8 @@ const ListSendView = props => {
</View>
);
};
const renderFilter = () =>{
const renderFilter = () => {
return (
<View style={styles.box_3}>
<View style={styles.searchBox}>
<Image source={R.images.icSearch} style={{width: 20, height: 20}} />
......@@ -228,12 +227,12 @@ const ListSendView = props => {
<Dropdown title={'Tìm kiếm'} height={35} />
</View>
</View>
)
}
);
};
const renderCard = () => {
return (
<View >
<View>
<View style={styles.card}>
<TouchableOpacity style={styles.btnCard}>
<Text
......
......@@ -22,8 +22,6 @@ const WorkReportModal = ({visible, onClose, onSubmit}) => {
};
const handleAddAttachment = () => {
// Handle add attachment logic
console.log('Add attachment');
};
return (
......
import { StyleSheet } from "react-native";
import R from "../../../../../assets/R";
import {StyleSheet} from 'react-native';
import R from '../../../../../assets/R';
const styles = StyleSheet.create({
overlay: {
......@@ -92,6 +92,6 @@ const styles = StyleSheet.create({
fontSize: 16,
fontWeight: '600',
},
});
});
export default styles;
......@@ -14,7 +14,6 @@ const WorkReportModalView = ({
onCancel,
onAddAttachment,
}) => {
return (
<Modal
visible={visible}
......@@ -34,7 +33,9 @@ const WorkReportModalView = ({
/>
<Text style={styles.label}>Tài liu đính kèm</Text>
<TouchableOpacity style={styles.attachmentContainer} onPress={onAddAttachment}>
<TouchableOpacity
style={styles.attachmentContainer}
onPress={onAddAttachment}>
<Image source={R.images.icDocument} style={styles.uploadIcon} />
<Text style={styles.attachmentText}>Thêm tài liu</Text>
</TouchableOpacity>
......
......@@ -4,7 +4,6 @@ import EditReportModalView from './view';
const EditReportModal = ({visible, onClose, onSubmit, initialContent = ''}) => {
const [reportContent, setReportContent] = useState(initialContent);
// Update reportContent when initialContent changes
useEffect(() => {
setReportContent(initialContent);
}, [initialContent]);
......@@ -26,13 +25,9 @@ const EditReportModal = ({visible, onClose, onSubmit, initialContent = ''}) => {
};
const handleDeleteAttachment = () => {
// Handle attachment deletion logic
console.log('Delete attachment');
};
const handleAddAttachment = () => {
// Handle add attachment logic
console.log('Add attachment');
};
return (
......
......@@ -4,12 +4,12 @@ import R from "../../../../../assets/R";
const styles = StyleSheet.create({
overlay: {
flex: 1,
backgroundColor: 'rgba(0, 0, 0, 0.5)',
backgroundColor: R.colors.blackShadow,
justifyContent: 'center',
alignItems: 'center',
},
modalContainer: {
backgroundColor: 'white',
backgroundColor: R.colors.white,
borderRadius: 12,
padding: 20,
width: '90%',
......@@ -98,12 +98,12 @@ const styles = StyleSheet.create({
alignItems: 'center',
},
cancelButtonText: {
color: 'white',
color: R.colors.white,
fontSize: 16,
fontWeight: '600',
},
submitButtonText: {
color: 'white',
color: R.colors.white,
fontSize: 16,
fontWeight: '600',
},
......
......@@ -14,7 +14,6 @@ const EditReportModalView = ({
onDeleteAttachment,
onAddAttachment,
}) => {
return (
<Modal
visible={visible}
......@@ -44,7 +43,9 @@ const EditReportModalView = ({
</TouchableOpacity>
</View>
<TouchableOpacity style={styles.attachmentContainer} onPress={onAddAttachment}>
<TouchableOpacity
style={styles.attachmentContainer}
onPress={onAddAttachment}>
<Image source={R.images.icDocument} style={styles.uploadIcon} />
<Text style={styles.attachmentText}>Thêm tài liu</Text>
</TouchableOpacity>
......
......@@ -34,7 +34,9 @@ const AddWorkModalView = props => {
const renderItem_1 = ({item, onPress}) => {
return (
<View style={styles.chip}>
<TouchableOpacity style={styles.containerIcon} onPress={() => handleItemPress(item)}>
<TouchableOpacity
style={styles.containerIcon}
onPress={() => handleItemPress(item)}>
<Image
resizeMode="cover"
source={R.images.icCancel}
......@@ -64,7 +66,7 @@ const AddWorkModalView = props => {
title="Tiêu đề"
required
value={formData.title}
onChangeText={(value) => updateFormData('title', value)}
onChangeText={value => updateFormData('title', value)}
containerMarginBottom={10}
/>
......@@ -72,7 +74,7 @@ const AddWorkModalView = props => {
title="Mô tả"
required
value={formData.content}
onChangeText={(value) => updateFormData('content', value)}
onChangeText={value => updateFormData('content', value)}
containerMarginBottom={10}
fontFamily={R.fonts.fontMedium}
titleFontSize={R.fontsize.fontSizeContent}
......@@ -158,7 +160,7 @@ const AddWorkModalView = props => {
title="Ngày đến hạn"
required
value={formData.deadline}
onChangeText={(value) => updateFormData('deadline', value)}
onChangeText={value => updateFormData('deadline', value)}
containerMarginBottom={10}
/>
......
......@@ -47,7 +47,7 @@ const AddMonitoringModal = ({visible, onClose, onSave}) => {
const workData = {
...formData,
selectedImplementers: selectedItems,
type: 'monitoring', // Đánh dấu đây là công việc giám sát
type: 'monitoring',
};
onSave(workData);
resetForm();
......
......@@ -55,7 +55,6 @@ const styles = StyleSheet.create({
chip: {
flexDirection: 'row',
alignItems: 'center',
// position: 'relative',
paddingLeft: 10,
paddingRight: 10,
height: 25,
......
......@@ -20,12 +20,9 @@ const AddMonitoringModalView = props => {
visible,
formData,
dataList,
selectedItems,
updateFormData,
handleSave,
handleClose,
handleSelectItem,
handleRemoveItem,
} = props;
const renderItem_1 = ({item, onPress}) => {
......
......@@ -9,7 +9,6 @@ const ModalRequestReport = props => {
const [reportDeadline, setReportDeadline] = useState('');
const handleSubmit = () => {
// Validation
if (!reportTitle.trim()) {
alert('Vui lòng nhập tiêu đề báo cáo');
return;
......@@ -23,7 +22,6 @@ const ModalRequestReport = props => {
return;
}
// Tạo data để submit
const reportData = {
title: reportTitle.trim(),
content: reportContent.trim(),
......@@ -32,10 +30,8 @@ const ModalRequestReport = props => {
implementers: workData?.implementer || [],
};
// Gọi callback để submit
onSubmitReport(reportData);
// Reset form
resetForm();
};
......
......@@ -21,7 +21,7 @@ const styles = StyleSheet.create({
height: 2,
},
shadowOpacity: 0.25,
padding:10
padding: 10,
},
modalHeader: {
flexDirection: 'row',
......@@ -36,7 +36,7 @@ const styles = StyleSheet.create({
fontWeight: '600',
fontFamily: R.fonts.fontMedium,
color: R.colors.blue,
textAlign:'center'
textAlign: 'center',
},
closeButton: {
padding: 5,
......@@ -151,16 +151,16 @@ const styles = StyleSheet.create({
fontFamily: R.fonts.fontMedium,
color: R.colors.white,
},
buttonContainerStyle:{
borderRadius:15,
color:R.colors.white,
buttonContainerStyle: {
borderRadius: 15,
color: R.colors.white,
},
containerButton: {
flexDirection: 'row',
justifyContent: 'flex-end',
alignItems: 'center',
marginTop: 10,
},
containerButton:{
flexDirection:'row',
justifyContent:'flex-end',
alignItems:'center',
marginTop:10
}
});
export default styles;
......@@ -3,10 +3,6 @@ import {
Modal,
View,
Text,
TouchableOpacity,
Image,
TextInput,
ScrollView,
} from 'react-native';
import styles from './style';
import R from '../../../../assets/R';
......@@ -18,13 +14,8 @@ const ModalRequestReportView = props => {
visible,
onClose,
onSubmit,
reportTitle,
setReportTitle,
reportContent,
setReportContent,
reportDeadline,
setReportDeadline,
implementers,
} = props;
return (
......@@ -35,9 +26,7 @@ const ModalRequestReportView = props => {
onRequestClose={onClose}>
<View style={styles.modalOverlay}>
<View style={styles.modalContainer}>
<Text style={styles.modalTitle}>
Yêu cu báo cáo
</Text>
<Text style={styles.modalTitle}>Yêu cu báo cáo</Text>
<TextField
title={'Hạn nộp báo cáo'}
required={true}
......@@ -67,8 +56,6 @@ const ModalRequestReportView = props => {
containerStyle={styles.buttonContainerStyle}
/>
</View>
</View>
</View>
</Modal>
......
......@@ -230,7 +230,7 @@ const DetailListWorkMonitoringView = props => {
return (
<View style={styles.container}>
<Header title={'Chi tiết công việc giám sát'} />
<Header title={'Chi tiết công việc giám sát'} isBack={true}/>
<ScrollView showsVerticalScrollIndicator={false}>
{renderBody()}
</ScrollView>
......
......@@ -24,7 +24,6 @@ const NotificationView = props => {
onSearchChange,
} = props;
const navigate = useNavigation();
//Xử lý render item cho tab view
const getRenderItemFunction = () => {
switch (activeTab) {
case 'Tuition':
......@@ -33,7 +32,6 @@ const NotificationView = props => {
return renderNotificationItemView;
}
};
//Xử lý màu trạng thái khi ở tab view
const getStatusColor = status => {
switch (status) {
case 'Đã gửi':
......@@ -44,7 +42,6 @@ const NotificationView = props => {
return R.colors.gray || '#9E9E9E';
}
};
//TabView
const renderTabViewItem = ({item}) => {
const isActivity = activeTab === item.key;
return (
......@@ -68,7 +65,6 @@ const NotificationView = props => {
</View>
);
};
//Search
const renderSearchBox = () => {
return (
<View style={styles.containerSearchBox}>
......@@ -92,7 +88,6 @@ const NotificationView = props => {
</View>
);
};
//List Notification View
const renderNotificationItemView = ({item}) => {
return (
<View style={styles.cardItem}>
......@@ -110,7 +105,6 @@ const NotificationView = props => {
</View>
);
};
//List Notification Tution
const renderNotificationItemTution = ({item}) => {
const statusColor = getStatusColor(item.status);
return (
......@@ -194,7 +188,6 @@ const NotificationView = props => {
/>
);
};
//Empty
const renderItemEmpty = () => {
return (
<View style={styles.containerEmpty}>
......@@ -206,7 +199,6 @@ const NotificationView = props => {
const renderList = () =>{
return (
<View style={styles.containerBody}>
{/* {(dataNotifi[activeTab] && dataNotifi[activeTab].length > 0) && renderSearchBox()} */}
{dataNotifi[activeTab].length === 0
? renderItemEmpty()
......
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