perf: project-wide optimization pass + UI/theme fixes
Optimization (audited across src/, typecheck green): - Crash guards: PurchaseAuction data?.result + stray text-node, AuctionItemDetail length>0, LiveAuction user?.contractorId, KYC params guard - Hoisted render-defined components: Login MinimalInput (keyboard-focus bug), TenderFullDetail Section/InfoBox (subtree remount) - Memoized hot paths: Spreadsheet ColumnHeaderRow/DataRow, list makeStyles, shared infinite-query select (stops per-render flatMap) - Removed hot-path/in-list console logs; SkeletonList 10->1 shimmer UI/theme: themed AppToast, redesigned sidebar drawer, list empty states, KYC WebView cleanup Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Opus 4.8
parent
7853bab639
commit
95d8e0a925
@@ -7,7 +7,7 @@ import PurchaseAuctionTile from './PurchaseAuctionTile';
|
||||
import { useDispatch } from 'react-redux';
|
||||
import { setAuction } from '../../Redux/Slices/SelectedAuction';
|
||||
import { SearchInput } from '../../components/SearchInput';
|
||||
import { Skeleton } from '../../components';
|
||||
import { Skeleton, EmptyState } from '../../components';
|
||||
import { allBooleanProps } from './types/types';
|
||||
import FilterModal from './Modal/FilterModal';
|
||||
import NavigationString from '../../Constant/NavigationString';
|
||||
@@ -25,8 +25,11 @@ const PurchaseAuction = () => {
|
||||
|
||||
function isAuctionActive(item: any): boolean {
|
||||
const now = moment();
|
||||
const start = moment(item?.keyDates?.auctionBidding?.startDateTime, format);
|
||||
const end = moment(item?.keyDates?.auctionBidding?.endDateTime, format);
|
||||
const bidding = item?.auctionStatus === 'Amended'
|
||||
? item?.amendedkeyDates?.auctionBidding
|
||||
: item?.keyDates?.auctionBidding;
|
||||
const start = moment(bidding?.startDateTime, format);
|
||||
const end = moment(bidding?.endDateTime, format);
|
||||
|
||||
if (!start.isValid() || !end.isValid()) return false;
|
||||
|
||||
@@ -67,7 +70,7 @@ const PurchaseAuction = () => {
|
||||
{isPending ? <Skeleton />
|
||||
:
|
||||
<FlatList
|
||||
data={data.result ?? []}
|
||||
data={data?.result ?? []}
|
||||
renderItem={({ item }) => (
|
||||
<PurchaseAuctionTile
|
||||
item={item}
|
||||
@@ -82,7 +85,7 @@ const PurchaseAuction = () => {
|
||||
/>
|
||||
)}
|
||||
showsVerticalScrollIndicator={false}
|
||||
contentContainerStyle={{ paddingBottom: 50, paddingTop: 10 }}
|
||||
contentContainerStyle={{ flexGrow: 1, paddingBottom: 50, paddingTop: 10 }}
|
||||
|
||||
onEndReached={loadMore}
|
||||
onEndReachedThreshold={0.1}
|
||||
@@ -92,6 +95,12 @@ const PurchaseAuction = () => {
|
||||
}}
|
||||
|
||||
ListFooterComponent={renderFooter}
|
||||
ListEmptyComponent={
|
||||
<EmptyState
|
||||
title="No purchased auctions found"
|
||||
subtitle="Auctions you purchase will appear here."
|
||||
/>
|
||||
}
|
||||
|
||||
refreshControl={
|
||||
<RefreshControl
|
||||
@@ -110,7 +119,7 @@ const PurchaseAuction = () => {
|
||||
}
|
||||
{allBoolean.isShowFilter && <View style={{ flex: 1 }}>
|
||||
<FilterModal visible={allBoolean.isShowFilter} onClose={() => { setAllBoolean((prev: any) => ({ ...prev, isShowFilter: false })) }} setFilter={setFilter} filter={filter} />
|
||||
</View>}.
|
||||
</View>}
|
||||
|
||||
</View>
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user