Resolve flatlist end covered.
This commit is contained in:
2
.gitignore
vendored
2
.gitignore
vendored
@@ -16,6 +16,8 @@ yarn-error.log
|
|||||||
|
|
||||||
*.ipa
|
*.ipa
|
||||||
*.aab
|
*.aab
|
||||||
|
*.tar.gz
|
||||||
|
*.apk
|
||||||
.expo
|
.expo
|
||||||
|
|
||||||
android/**
|
android/**
|
||||||
|
|||||||
@@ -44,6 +44,9 @@ function JobListItemComponent({ openImagePicker, item }) {
|
|||||||
}`.trim();
|
}`.trim();
|
||||||
const roNumber = item.ro_number || t("general.labels.na");
|
const roNumber = item.ro_number || t("general.labels.na");
|
||||||
|
|
||||||
|
if (item.id === "footer-spacer") {
|
||||||
|
return <View style={{ height: 64 }} />;
|
||||||
|
}
|
||||||
return (
|
return (
|
||||||
<Pressable
|
<Pressable
|
||||||
onPress={onPress}
|
onPress={onPress}
|
||||||
@@ -81,7 +84,7 @@ function JobListItemComponent({ openImagePicker, item }) {
|
|||||||
<Text
|
<Text
|
||||||
variant="bodyMedium"
|
variant="bodyMedium"
|
||||||
numberOfLines={1}
|
numberOfLines={1}
|
||||||
style={{ marginTop: 4 }}
|
style={{ marginTop: 4, flex: 1 }}
|
||||||
>
|
>
|
||||||
{vehicle}
|
{vehicle}
|
||||||
</Text>
|
</Text>
|
||||||
@@ -155,11 +158,15 @@ const styles = StyleSheet.create({
|
|||||||
opacity: 0.9,
|
opacity: 0.9,
|
||||||
},
|
},
|
||||||
uploadButton: {
|
uploadButton: {
|
||||||
margin: 0,
|
marginLeft: 12,
|
||||||
},
|
},
|
||||||
body: {
|
body: {
|
||||||
marginTop: 2,
|
marginTop: 2,
|
||||||
flexDirection: "row", gap: 8, alignItems: "center",
|
display: "flex",
|
||||||
|
flex: 1,
|
||||||
|
flexDirection: "row",
|
||||||
|
gap: 8,
|
||||||
|
alignItems: "center",
|
||||||
},
|
},
|
||||||
ownerText: {
|
ownerText: {
|
||||||
fontWeight: "600",
|
fontWeight: "600",
|
||||||
|
|||||||
@@ -1,5 +1,4 @@
|
|||||||
import { useQuery } from "@apollo/client";
|
import { useQuery } from "@apollo/client";
|
||||||
import { useLocalSearchParams } from "expo-router";
|
|
||||||
import React from "react";
|
import React from "react";
|
||||||
import { useTranslation } from "react-i18next";
|
import { useTranslation } from "react-i18next";
|
||||||
import { FlatList, RefreshControl, Text, View } from "react-native";
|
import { FlatList, RefreshControl, Text, View } from "react-native";
|
||||||
@@ -19,7 +18,6 @@ const mapStateToProps = createStructuredSelector({
|
|||||||
|
|
||||||
export function JobListComponent({ bodyshop }) {
|
export function JobListComponent({ bodyshop }) {
|
||||||
const { t } = useTranslation();
|
const { t } = useTranslation();
|
||||||
const { search } = useLocalSearchParams();
|
|
||||||
|
|
||||||
const { loading, error, data, refetch } = useQuery(QUERY_ALL_ACTIVE_JOBS, {
|
const { loading, error, data, refetch } = useQuery(QUERY_ALL_ACTIVE_JOBS, {
|
||||||
variables: {
|
variables: {
|
||||||
@@ -47,24 +45,7 @@ export function JobListComponent({ bodyshop }) {
|
|||||||
</View>
|
</View>
|
||||||
);
|
);
|
||||||
|
|
||||||
const jobs = data
|
const jobs = data ? [...(data?.jobs || []), { id: "footer-spacer" }] : [];
|
||||||
? search === "" || !search
|
|
||||||
? data.jobs
|
|
||||||
: data.jobs.filter(
|
|
||||||
(j) =>
|
|
||||||
(j.ro_number || "")
|
|
||||||
.toString()
|
|
||||||
.toLowerCase()
|
|
||||||
.includes(search.toLowerCase()) ||
|
|
||||||
(j.ownr_co_nm || "").toLowerCase().includes(search.toLowerCase()) ||
|
|
||||||
(j.ownr_fn || "").toLowerCase().includes(search.toLowerCase()) ||
|
|
||||||
(j.ownr_ln || "").toLowerCase().includes(search.toLowerCase()) ||
|
|
||||||
(j.v_model_desc || "")
|
|
||||||
.toLowerCase()
|
|
||||||
.includes(search.toLowerCase()) ||
|
|
||||||
(j.v_make_desc || "").toLowerCase().includes(search.toLowerCase())
|
|
||||||
)
|
|
||||||
: [];
|
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<SafeAreaView style={{ flex: 1 }}>
|
<SafeAreaView style={{ flex: 1 }}>
|
||||||
|
|||||||
Reference in New Issue
Block a user