enh
This commit is contained in:
parent
2f9e0e4986
commit
4de296410c
3 changed files with 37 additions and 5 deletions
|
|
@ -36,6 +36,9 @@ dayjs.extend(relativeTime);
|
|||
const { width: screenWidth } = Dimensions.get("window");
|
||||
const itemWidth = screenWidth * 0.45;
|
||||
const heroItemWidth = (screenWidth - 72) / 3;
|
||||
// Catalog rows sit on the page's 16px margin: 32px of gutter + two 8px gaps
|
||||
// leaves each of the three cards this wide.
|
||||
const catalogItemWidth = (screenWidth - 48) / 3;
|
||||
const gridItemWidth = (screenWidth - 48) / 2;
|
||||
|
||||
const formatTimeRange = (deliveryTime: string) => {
|
||||
|
|
@ -53,6 +56,8 @@ const formatTimeRange = (deliveryTime: string) => {
|
|||
|
||||
const staticStyles = {
|
||||
flatListContent: { gap: 16 },
|
||||
// 16px page margin, matching the rest of the screen. With catalogItemWidth
|
||||
// that leaves an 8px gap between the three cards, like the tag grid.
|
||||
columnWrapper: { justifyContent: 'space-between', paddingHorizontal: 16 },
|
||||
slotsListContent: { paddingBottom: 24 },
|
||||
} as const;
|
||||
|
|
@ -359,7 +364,7 @@ const ProductItem = memo(({ item, onPress }: ProductItemProps) => {
|
|||
<View style={tw`mb-3`} testID={`product-item-${item.id}`}>
|
||||
<ProductCard
|
||||
item={item}
|
||||
itemWidth={heroItemWidth}
|
||||
itemWidth={catalogItemWidth}
|
||||
onPress={handlePress}
|
||||
showDeliveryInfo={false}
|
||||
miniView={true}
|
||||
|
|
|
|||
|
|
@ -18,8 +18,8 @@ import TabLayoutWrapper from "@/components/TabLayoutWrapper";
|
|||
import LocationBar from "@/src/components/LocationBar";
|
||||
|
||||
const { width: screenWidth } = Dimensions.get("window");
|
||||
// Same 3-column hero card sizing used on the home page.
|
||||
const heroItemWidth = (screenWidth - 72) / 3;
|
||||
// Same 3-column sizing as the home catalog grid: 16px page margin, 8px gaps.
|
||||
const catalogItemWidth = (screenWidth - 48) / 3;
|
||||
const SHOW_MORE_STEP = 6;
|
||||
|
||||
// Grid section (home page style): shows the first SHOW_MORE_STEP products
|
||||
|
|
@ -55,12 +55,12 @@ const OffersSection = ({
|
|||
</View>
|
||||
) : (
|
||||
<>
|
||||
<View style={tw`flex-row flex-wrap gap-5 px-4`}>
|
||||
<View style={[tw`flex-row flex-wrap px-4`, { columnGap: 8 }]}>
|
||||
{visible.map((item: any) => (
|
||||
<View key={item.id} style={tw`mb-3`}>
|
||||
<ProductCard
|
||||
item={item}
|
||||
itemWidth={heroItemWidth}
|
||||
itemWidth={catalogItemWidth}
|
||||
onPress={() => onProductPress(item.id)}
|
||||
showDeliveryInfo={false}
|
||||
useAddToCartDialog={true}
|
||||
|
|
|
|||
|
|
@ -66,3 +66,30 @@
|
|||
~ complaint.raise uses notifyRegionAdmins(complaint.regionId, ...).
|
||||
--- apps/backend/tests/unit/admin-notif.test.ts
|
||||
~ Rewritten for region scoping + manual broadcast; asserts null region is a no-op.
|
||||
|
||||
[2026-11-01 12:32:24 IST] user-ui home: match the All Available Products grid spacing to the tag grid.
|
||||
|
||||
--- apps/user-ui/app/(drawer)/(tabs)/home/index.tsx
|
||||
~ staticStyles.columnWrapper.paddingHorizontal 16 -> 28. Cards keep
|
||||
heroItemWidth, so the horizontal gap becomes 8px, identical to the tag grid
|
||||
(mx-4 + px-3 = 28px inset, same 8px gaps).
|
||||
~ All Available Products heading row px-1 -> px-3 so the title sits on the same
|
||||
28px gutter as the rows.
|
||||
No data, paging, or card changes.
|
||||
|
||||
[2026-11-01 12:34:02 IST] user-ui home: give the catalog grid the extra space as card width.
|
||||
|
||||
--- apps/user-ui/app/(drawer)/(tabs)/home/index.tsx
|
||||
~ Reverts the 28px row gutter: columnWrapper.paddingHorizontal back to 16 so the
|
||||
grid keeps the page's 16px margin (and the heading returns to px-1).
|
||||
+ catalogItemWidth = (screenWidth - 48) / 3; ProductItem (catalog rows only)
|
||||
uses it instead of heroItemWidth, so three cards fill the row with 8px gaps.
|
||||
Tag grid keeps heroItemWidth inside its 28px inset card.
|
||||
|
||||
[2026-11-01 12:37:54 IST] user-ui Offers/Combos: same compact 3-up grid as the home catalog.
|
||||
|
||||
--- apps/user-ui/app/(drawer)/(tabs)/order-again/index.tsx
|
||||
~ heroItemWidth -> catalogItemWidth = (screenWidth - 48) / 3.
|
||||
~ Grid gap-5 (20px) -> gap-2 (8px); px-4 page margin unchanged.
|
||||
Three cards now fill the row, matching the All Available Products grid.
|
||||
Web offers page already uses a 12px grid gap (gap-3), so no web change.
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue