This commit is contained in:
shafi54 2026-01-29 01:58:38 +05:30
parent 2929e7725a
commit b4a1874e55
3 changed files with 13 additions and 14 deletions

View file

@ -1,6 +0,0 @@
I have a mobile app meant for online shopping. People can shop for meat, fruits and dry fruits.
my major colors are #F83758 and #fff0f6. I want just an info web site. I want the website
to tell people that we sell the trust of local and the convenience of online. I want to highlight
the process of selling. the steps are Find products, select a delivery slot, and get order delivered
I want the site to be a jolly and fun theme one baked primarily in the colors I've given. Make
it a node js app with pug and a statically rendered home page.

View file

@ -40,7 +40,7 @@ dayjs.extend(relativeTime);
const { width: screenWidth } = Dimensions.get("window"); const { width: screenWidth } = Dimensions.get("window");
const itemWidth = screenWidth * 0.45; // 45% of screen width const itemWidth = screenWidth * 0.45; // 45% of screen width
const gridItemWidth = (screenWidth * 0.9) / 2; // Half of screen width minus padding const gridItemWidth = (screenWidth - 48) / 2; // Half of screen width minus padding
const RenderStore = ({ const RenderStore = ({
item, item,
@ -149,7 +149,9 @@ export default function Dashboard() {
// return !product.isOutOfStock; // return !product.isOutOfStock;
// }); // });
const initialBatch = initialBatchRaw.sort((a, b) => { const initialBatch = initialBatchRaw
.filter(p => typeof p.id === "number")
.sort((a, b) => {
const slotA = getQuickestSlot(a.id); const slotA = getQuickestSlot(a.id);
const slotB = getQuickestSlot(b.id); const slotB = getQuickestSlot(b.id);
@ -161,6 +163,7 @@ export default function Dashboard() {
return 0; return 0;
}) })
setDisplayedProducts(initialBatch); setDisplayedProducts(initialBatch);
setHasMore(products.length > 10); setHasMore(products.length > 10);
setEndIndex(10); setEndIndex(10);
@ -233,6 +236,7 @@ export default function Dashboard() {
} }
return ( return (
<TabLayoutWrapper> <TabLayoutWrapper>
{/* <ExpoStatusBar style="light" backgroundColor={headerColor} /> */} {/* <ExpoStatusBar style="light" backgroundColor={headerColor} /> */}
@ -589,12 +593,13 @@ export default function Dashboard() {
<MyFlatList <MyFlatList
// data={products} // data={products}
data={displayedProducts} data={displayedProducts}
keyExtractor={(item) => item.id.toString()} keyExtractor={(item) => item.id}
numColumns={2} numColumns={2}
contentContainerStyle={tw`pb-8`} // contentContainerStyle={tw`pb-8`}
columnWrapperStyle={tw`py-2`} contentContainerStyle={[tw` pb-24`, { gap: 16 }]}
columnWrapperStyle={{gap: 16}}
renderItem={({ item, index }) => ( renderItem={({ item, index }) => (
<View style={tw`ml-1`}>
<ProductCard <ProductCard
item={item} item={item}
itemWidth={gridItemWidth} itemWidth={gridItemWidth}
@ -608,7 +613,7 @@ export default function Dashboard() {
key={item.id} key={item.id}
/> />
</View>
)} )}
initialNumToRender={4} initialNumToRender={4}
maxToRenderPerBatch={4} maxToRenderPerBatch={4}