Commit 9fce00aa by tungnq

TODO: Đã hoàn thiện giao diện tạo công việc

parent 6a213b97
...@@ -2,10 +2,8 @@ import React from 'react'; ...@@ -2,10 +2,8 @@ import React from 'react';
import {Text, View, StyleSheet} from 'react-native'; import {Text, View, StyleSheet} from 'react-native';
import ListWorkView from './view'; import ListWorkView from './view';
const ListWork = (props) => { const ListWork = props => {
return ( return <ListWorkView />;
<ListWorkView />
);
}; };
export default ListWork; export default ListWork;
import {StyleSheet} from 'react-native';
import R from '../../../assets/R';
const styles = StyleSheet.create({
overlay: {
flex: 1,
backgroundColor: R.colors.blackShadow,
justifyContent: 'center',
alignItems: 'center',
},
modalContainer: {
backgroundColor: 'white',
borderRadius: 15,
maxHeight: '70%',
paddingVertical: 20,
marginHorizontal: 15,
},
header: {
alignItems: 'center',
paddingBottom: 20,
marginHorizontal: 20,
},
headerTitle: {
fontSize: R.fontsize.fontsSizeTitle,
fontFamily: R.fonts.fontMedium,
fontWeight: '600',
color: R.colors.blue,
},
formContainer: {
paddingHorizontal: 20,
},
fieldContainer: {
marginBottom: 20,
},
containerDropDown: {
marginBottom: 10,
},
imageIcon: {
width: 15,
height: 15,
},
label: {
fontSize: R.fontsize.fontSizeLabel,
fontFamily: R.fonts.fontMedium,
fontWeight: '600',
color: R.colors.black,
},
required: {
color: 'red',
},
textInput: {
borderWidth: 1,
borderColor: R.colors.grayBorderInputTextHeader,
borderRadius: 10,
paddingHorizontal: 10,
paddingVertical: 5,
},
textArea: {
height: 80,
textAlignVertical: 'top',
},
flatListSelect: {
flexDirection: 'row',
flexWrap: 'wrap',
},
textChip: {
fontSize: R.fontsize.fontSizeContent,
fontWeight: '400',
fontFamily: R.fonts.fontRegular,
color: R.colors.blueTextChip,
},
text_2: {
fontSize: R.fontsize.fontSizeContent,
fontFamily: R.fonts.fontMedium,
fontWeight: '600',
color: R.colors.black,
},
pickerContainer: {
borderWidth: 1,
borderColor: '#ddd',
borderRadius: 8,
backgroundColor: 'white',
},
datePickerContainer: {
flexDirection: 'row',
justifyContent: 'space-between',
alignItems: 'center',
borderWidth: 1,
borderColor: '#ddd',
borderRadius: 8,
paddingHorizontal: 12,
paddingVertical: 12,
backgroundColor: 'white',
},
datePickerText: {
fontSize: 14,
color: '#666',
},
containerIcon: {
marginRight: 2,
},
fileUploadContainer: {
borderWidth: 2,
borderColor: '#ddd',
borderStyle: 'dashed',
borderRadius: 8,
paddingVertical: 30,
alignItems: 'center',
backgroundColor: '#f9f9f9',
},
fileUploadText: {
marginTop: 8,
fontSize: 14,
color: R.colors.blue,
fontWeight: '500',
},
buttonContainer: {
flexDirection: 'row',
justifyContent: 'flex-end',
paddingHorizontal: 20,
paddingTop: 20,
gap: 10,
},
cancelButton: {
flex: 1,
justifyContent: 'center',
backgroundColor: R.colors.orange,
alignItems: 'center',
},
cancelButtonText: {
fontSize: 16,
color: '#666',
fontWeight: '500',
},
saveButton: {
flex: 1,
paddingVertical: 12,
borderRadius: 8,
backgroundColor: R.colors.blue,
alignItems: 'center',
},
saveButtonText: {
fontSize: 16,
color: 'white',
fontWeight: '500',
},
chip: {
flexDirection: 'row',
alignItems: 'center',
paddingLeft: 10,
paddingRight: 10,
height: 25,
borderRadius: 10,
marginBottom: 10,
marginRight: 5,
backgroundColor: R.colors.blue2,
alignSelf: 'flex-start',
},
});
export default styles;
import { StyleSheet, Text, View } from 'react-native' import {StyleSheet, Text, View} from 'react-native';
import R from '../../assets/R' import R from '../../assets/R';
const styles = StyleSheet.create({ const styles = StyleSheet.create({
container:{ container: {
flex:1, flex: 1,
backgroundColor:R.colors.white backgroundColor: R.colors.white,
}, },
body:{ body: {
flex:1, flex: 1,
backgroundColor:R.colors.white backgroundColor: R.colors.white,
}, },
card:{ card: {
borderWidth:1, borderWidth: 1,
borderColor:R.colors.grayBorderInputTextHeader, borderColor: R.colors.grayBorderInputTextHeader,
borderRadius:10, borderRadius: 10,
padding:5, padding: 5,
marginTop:15, marginTop: 15,
marginBottom:15, marginBottom: 15,
marginHorizontal:15, marginHorizontal: 15,
alignItems:'center', alignItems: 'center',
justifyContent:'center', justifyContent: 'center',
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},
shadowOpacity:Platform.OS === 'ios' ? 0.25 : 1, shadowOpacity: Platform.OS === 'ios' ? 0.25 : 1,
shadowRadius:5, shadowRadius: 5,
elevation:Platform.OS === 'ios' ? 1 : 2, elevation: Platform.OS === 'ios' ? 1 : 2,
}, },
btnCard:{ btnCard: {
borderRadius:10, borderRadius: 10,
borderWidth:1, borderWidth: 1,
padding:5, padding: 5,
width:'100%', width: '100%',
alignItems:'center', alignItems: 'center',
justifyContent:'center', justifyContent: 'center',
borderColor:R.colors.grayBorderInputTextHeader, borderColor: R.colors.grayBorderInputTextHeader,
}, },
text:{ text: {
fontSize:R.sizes.sm, fontSize: R.sizes.sm,
color:R.colors.black, color: R.colors.black,
fontFamily:R.fonts.fontRegular, fontFamily: R.fonts.fontRegular,
fontWeight:'400', fontWeight: '400',
}, },
searchBox:{ searchBox: {
flex:1, flex: 1,
borderWidth:1, borderWidth: 1,
borderColor:R.colors.grayBorderInputTextHeader, borderColor: R.colors.grayBorderInputTextHeader,
borderRadius:20, borderRadius: 20,
alignItems:'center', alignItems: 'center',
justifyContent:'flex-start', justifyContent: 'flex-start',
paddingLeft:15, paddingLeft: 15,
flexDirection:'row', flexDirection: 'row',
height:42 height: 42,
}, },
box_3:{ box_3: {
flexDirection:'row', flexDirection: 'row',
marginHorizontal:15, marginHorizontal: 15,
alignItems:'center', alignItems: 'center',
}, },
}) });
export default styles export default styles;
\ No newline at end of file
import React, { useState } from 'react'; import React, {useState} from 'react';
import {Text, View, TouchableOpacity, StyleSheet, Image, TextInput} from 'react-native'; import {
Text,
View,
TouchableOpacity,
StyleSheet,
Image,
TextInput,
} from 'react-native';
import styles from './style'; import styles from './style';
import FAB from '../../components/FAB/fab'; import FAB from '../../components/FAB/fab';
import SubButton from '../../components/FAB/sub_button'; import SubButton from '../../components/FAB/sub_button';
...@@ -9,15 +16,12 @@ import R from '../../assets/R'; ...@@ -9,15 +16,12 @@ import R from '../../assets/R';
import TabViewComponent from '../../components/TabView'; import TabViewComponent from '../../components/TabView';
import AddWorkModal from '../list_work/modal_add/index'; import AddWorkModal from '../list_work/modal_add/index';
const ListWorkView = (props) => { const ListWorkView = props => {
const { const {searchQuery, setSearchQuery} = props;
searchQuery,
setSearchQuery,
} = props;
const [modalVisible, setModalVisible] = useState(false); const [modalVisible, setModalVisible] = useState(false);
const handleFilterChange = (item) => { const handleFilterChange = item => {
console.log(item); console.log(item);
}; };
...@@ -25,7 +29,7 @@ const ListWorkView = (props) => { ...@@ -25,7 +29,7 @@ const ListWorkView = (props) => {
setModalVisible(true); setModalVisible(true);
}; };
const handleSaveWork = (workData) => { const handleSaveWork = workData => {
console.log('Saving work:', workData); console.log('Saving work:', workData);
}; };
...@@ -34,53 +38,51 @@ const ListWorkView = (props) => { ...@@ -34,53 +38,51 @@ const ListWorkView = (props) => {
}; };
const renderTabView = () => { const renderTabView = () => {
return ( <TabViewComponent return (
data={[ <TabViewComponent
{key: 'all', label: 'Tất cả'}, data={[
{key: 'public', label: 'Công khai'}, {key: 'all', label: 'Tất cả'},
{key: 'private', label: 'Hạn chế'}, {key: 'public', label: 'Công khai'},
{key: 'draft', label: 'Nháp'}, {key: 'private', label: 'Hạn chế'},
]} {key: 'draft', label: 'Nháp'},
tabStyle={{ ]}
backgroundColor: R.colors.gray, tabStyle={{
marginHorizontal: 5, backgroundColor: R.colors.gray,
borderRadius: 10, marginHorizontal: 5,
width : 100, borderRadius: 10,
height : 35, width: 100,
justifyContent : 'center', height: 35,
alignItems : 'center', justifyContent: 'center',
}} alignItems: 'center',
style={{ }}
marginVertical: 5, style={{
}} marginVertical: 5,
mode="filter" }}
defaultActiveKey="all" mode="filter"
scrollable={true} defaultActiveKey="all"
activeTabStyle={{ scrollable={true}
backgroundColor: R.colors.blue, activeTabStyle={{
}} backgroundColor: R.colors.blue,
textStyle={{ }}
color: R.colors.white, textStyle={{
fontWeight : '400', color: R.colors.white,
fontFamily : R.fonts.fontRegular, fontWeight: '400',
fontSize : R.fontsize.fontSizeContent, fontFamily: R.fonts.fontRegular,
fontSize: R.fontsize.fontSizeContent,
}} }}
showActiveIndicator={false} showActiveIndicator={false}
onFilterChange={handleFilterChange}
onFilterChange={handleFilterChange} />
/> );
) };
}
return ( return (
<View <View style={styles.container}>
style={styles.container}> <Header title={'Danh sách công việc'} isBack />
<Header title={'Danh sách công việc'} isBack /> <View style={styles.body}>
<View style = {styles.body}> {renderTabView()}
{renderTabView()}
<View style={{marginBottom: 15}}> <View style={{marginBottom: 15}}>
<View style={styles.card}> <View style={styles.card}>
<TouchableOpacity style={styles.btnCard}> <TouchableOpacity style={styles.btnCard}>
<Text style={styles.text}>Hc k 2, Năm 2025</Text> <Text style={styles.text}>Hc k 2, Năm 2025</Text>
...@@ -93,42 +95,37 @@ const ListWorkView = (props) => { ...@@ -93,42 +95,37 @@ const ListWorkView = (props) => {
source={R.images.icSearch} source={R.images.icSearch}
style={{width: 20, height: 20}} 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"
style={styles.text} style={styles.text}
value={searchQuery} value={searchQuery}
onChangeText={setSearchQuery} onChangeText={setSearchQuery}
/> />
</View> </View>
</View> </View>
<View style={{flex: 0.1}}></View> <View style={{flex: 0.1}}></View>
<View style={styles.boxFilter}> <View style={styles.boxFilter}>
<Dropdown title={'Tìm kiếm'} height={40}/> <Dropdown title={'Tìm kiếm'} height={40} />
</View> </View>
</View> </View>
</View> </View>
</View>
<FAB>
<SubButton
onPress={handleAddWork}
label="Tạo công việc"
images={R.images.icMenuEdit}
backgroundColor={R.colors.blue}
/>
</FAB>
<AddWorkModal
visible={modalVisible}
</View> onClose={handleCloseModal}
<FAB> onSave={handleSaveWork}
<SubButton
onPress={handleAddWork}
label="Tạo công việc"
images={R.images.icMenuEdit}
backgroundColor={R.colors.blue}
/> />
</FAB>
<AddWorkModal
visible={modalVisible}
onClose={handleCloseModal}
onSave={handleSaveWork}
/>
</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