Resolve flatlist end covered.

This commit is contained in:
Patrick Fic
2025-10-23 12:25:13 -07:00
parent 41a3a1fccf
commit b6271b8ef2
3 changed files with 13 additions and 23 deletions

View File

@@ -1,5 +1,4 @@
import { useQuery } from "@apollo/client";
import { useLocalSearchParams } from "expo-router";
import React from "react";
import { useTranslation } from "react-i18next";
import { FlatList, RefreshControl, Text, View } from "react-native";
@@ -19,7 +18,6 @@ const mapStateToProps = createStructuredSelector({
export function JobListComponent({ bodyshop }) {
const { t } = useTranslation();
const { search } = useLocalSearchParams();
const { loading, error, data, refetch } = useQuery(QUERY_ALL_ACTIVE_JOBS, {
variables: {
@@ -47,24 +45,7 @@ export function JobListComponent({ bodyshop }) {
</View>
);
const jobs = data
? 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())
)
: [];
const jobs = data ? [...(data?.jobs || []), { id: "footer-spacer" }] : [];
return (
<SafeAreaView style={{ flex: 1 }}>