|
|
|
@ -6,6 +6,7 @@ import {
@@ -6,6 +6,7 @@ import {
|
|
|
|
|
ListRenderItemInfo, |
|
|
|
|
StyleSheet, |
|
|
|
|
TouchableOpacity, |
|
|
|
|
View, |
|
|
|
|
} from 'react-native' |
|
|
|
|
import { DocumentPreview } from '../atoms' |
|
|
|
|
import { ShortTaskDocument } from '../interfaces' |
|
|
|
@ -21,10 +22,7 @@ export const TaskDetailsAttachmentsList: FC<TaskDetailsAttachmentsListProps> =
@@ -21,10 +22,7 @@ export const TaskDetailsAttachmentsList: FC<TaskDetailsAttachmentsListProps> =
|
|
|
|
|
({ attachments, allowDelete, onAddFile, onDeleteFile }) => { |
|
|
|
|
const { styles, theme } = useTheme(createStyles) |
|
|
|
|
|
|
|
|
|
const renderItem = ({ |
|
|
|
|
item, |
|
|
|
|
index: i, |
|
|
|
|
}: ListRenderItemInfo<ShortTaskDocument>) => { |
|
|
|
|
const renderItem = (item: ShortTaskDocument, i: number) => { |
|
|
|
|
return ( |
|
|
|
|
<TouchableOpacity |
|
|
|
|
key={`${item}---${i}`} |
|
|
|
@ -38,15 +36,18 @@ export const TaskDetailsAttachmentsList: FC<TaskDetailsAttachmentsListProps> =
@@ -38,15 +36,18 @@ export const TaskDetailsAttachmentsList: FC<TaskDetailsAttachmentsListProps> =
|
|
|
|
|
) |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
const renderItems = () => attachments.map(renderItem) |
|
|
|
|
|
|
|
|
|
return ( |
|
|
|
|
<> |
|
|
|
|
<FlatList |
|
|
|
|
<View style={styles.listContainer}>{renderItems()}</View> |
|
|
|
|
{/* <FlatList |
|
|
|
|
data={attachments} |
|
|
|
|
contentContainerStyle={styles.listContainer} |
|
|
|
|
columnWrapperStyle={styles.columnWrapperStyle} |
|
|
|
|
numColumns={3} |
|
|
|
|
renderItem={renderItem} |
|
|
|
|
/> |
|
|
|
|
/> */} |
|
|
|
|
|
|
|
|
|
<TouchableOpacity style={styles.addFile} onPress={onAddFile}> |
|
|
|
|
<IconComponent |
|
|
|
@ -66,19 +67,26 @@ const createStyles = (theme: PartialTheme) =>
@@ -66,19 +67,26 @@ const createStyles = (theme: PartialTheme) =>
|
|
|
|
|
StyleSheet.create({ |
|
|
|
|
columnWrapperStyle: { |
|
|
|
|
paddingVertical: $size(10), |
|
|
|
|
marginHorizontal: -$size(8), |
|
|
|
|
}, |
|
|
|
|
container: { |
|
|
|
|
width: $size(104, 95), |
|
|
|
|
width: '33%', |
|
|
|
|
height: $size(104, 95), |
|
|
|
|
marginBottom: $size(15, 10), |
|
|
|
|
marginHorizontal: $size(8), |
|
|
|
|
// marginBottom: $size(15, 10),
|
|
|
|
|
// marginHorizontal: $size(8),
|
|
|
|
|
// backgroundColor: '#000',
|
|
|
|
|
// width: '30%',
|
|
|
|
|
}, |
|
|
|
|
listContainer: { |
|
|
|
|
flexDirection: 'row', |
|
|
|
|
justifyContent: 'flex-start', |
|
|
|
|
alignItems: 'center', |
|
|
|
|
flexWrap: 'wrap', |
|
|
|
|
}, |
|
|
|
|
item: {}, |
|
|
|
|
addFile: { |
|
|
|
|
flexDirection: 'row', |
|
|
|
|
alignItems: 'center', |
|
|
|
|
paddingBottom: $size(20), |
|
|
|
|
paddingVertical: $size(20), |
|
|
|
|
borderBottomWidth: 1, |
|
|
|
|
borderBottomColor: theme.$border, |
|
|
|
|
}, |
|
|
|
|