Remove duplicated virtualized lists.
This commit is contained in:
@@ -1,4 +1,4 @@
|
|||||||
import { Container, Content, Thumbnail } from "native-base";
|
import { Thumbnail } from "native-base";
|
||||||
import React, { useState } from "react";
|
import React, { useState } from "react";
|
||||||
import {
|
import {
|
||||||
FlatList,
|
FlatList,
|
||||||
@@ -6,6 +6,7 @@ import {
|
|||||||
StyleSheet,
|
StyleSheet,
|
||||||
Text,
|
Text,
|
||||||
TouchableOpacity,
|
TouchableOpacity,
|
||||||
|
View,
|
||||||
} from "react-native";
|
} from "react-native";
|
||||||
import MediaCacheOverlay from "../media-cache-overlay/media-cache-overlay.component";
|
import MediaCacheOverlay from "../media-cache-overlay/media-cache-overlay.component";
|
||||||
|
|
||||||
@@ -20,16 +21,12 @@ export default function JobDocumentsComponent({ job, loading, refetch }) {
|
|||||||
return refetch();
|
return refetch();
|
||||||
};
|
};
|
||||||
return (
|
return (
|
||||||
<Container>
|
<View>
|
||||||
<Content
|
<FlatList
|
||||||
padder
|
|
||||||
refreshControl={
|
refreshControl={
|
||||||
<RefreshControl refreshing={loading} onRefresh={onRefresh} />
|
<RefreshControl refreshing={loading} onRefresh={onRefresh} />
|
||||||
}
|
}
|
||||||
>
|
|
||||||
<FlatList
|
|
||||||
data={job.documents}
|
data={job.documents}
|
||||||
style={{ flex: 1 }}
|
|
||||||
contentContainerStyle={styles.listContentContainer}
|
contentContainerStyle={styles.listContentContainer}
|
||||||
keyExtractor={(item) => item.id}
|
keyExtractor={(item) => item.id}
|
||||||
numColumns={4}
|
numColumns={4}
|
||||||
@@ -58,8 +55,7 @@ export default function JobDocumentsComponent({ job, loading, refetch }) {
|
|||||||
previewVisible={previewVisible}
|
previewVisible={previewVisible}
|
||||||
setPreviewVisible={setPreviewVisible}
|
setPreviewVisible={setPreviewVisible}
|
||||||
/>
|
/>
|
||||||
</Content>
|
</View>
|
||||||
</Container>
|
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -1,11 +1,12 @@
|
|||||||
import { Card, CardItem, Container, Content, Text } from "native-base";
|
import Dinero from "dinero.js";
|
||||||
|
import { Card, CardItem, Text } from "native-base";
|
||||||
import React from "react";
|
import React from "react";
|
||||||
import { useTranslation } from "react-i18next";
|
import { useTranslation } from "react-i18next";
|
||||||
import { FlatList, RefreshControl, StyleSheet } from "react-native";
|
import { FlatList, RefreshControl, StyleSheet, View } from "react-native";
|
||||||
import Dinero from "dinero.js";
|
|
||||||
|
|
||||||
export default function JobLines({ job, loading, refetch }) {
|
export default function JobLines({ job, loading, refetch }) {
|
||||||
const { t } = useTranslation();
|
const { t } = useTranslation();
|
||||||
|
|
||||||
if (!job) {
|
if (!job) {
|
||||||
<Card>
|
<Card>
|
||||||
<Text>Job is not defined.</Text>
|
<Text>Job is not defined.</Text>
|
||||||
@@ -16,16 +17,12 @@ export default function JobLines({ job, loading, refetch }) {
|
|||||||
};
|
};
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<Container>
|
<View>
|
||||||
<Content
|
<FlatList
|
||||||
padder
|
data={job.joblines}
|
||||||
refreshControl={
|
refreshControl={
|
||||||
<RefreshControl refreshing={loading} onRefresh={onRefresh} />
|
<RefreshControl refreshing={loading} onRefresh={onRefresh} />
|
||||||
}
|
}
|
||||||
>
|
|
||||||
<FlatList
|
|
||||||
data={job.joblines}
|
|
||||||
style={{ flex: 1 }}
|
|
||||||
contentContainerStyle={localStyles.listContentContainer}
|
contentContainerStyle={localStyles.listContentContainer}
|
||||||
keyExtractor={(item) => item.id}
|
keyExtractor={(item) => item.id}
|
||||||
renderItem={(object) => (
|
renderItem={(object) => (
|
||||||
@@ -57,8 +54,7 @@ export default function JobLines({ job, loading, refetch }) {
|
|||||||
</Card>
|
</Card>
|
||||||
)}
|
)}
|
||||||
/>
|
/>
|
||||||
</Content>
|
</View>
|
||||||
</Container>
|
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user