enh
This commit is contained in:
parent
6239910707
commit
f73fd76148
5 changed files with 73 additions and 13 deletions
|
|
@ -5,7 +5,9 @@ import path from 'path'
|
|||
|
||||
export default defineConfig({
|
||||
base: '/',
|
||||
plugins: [react()],
|
||||
// @vitejs/plugin-react-swc ships its own vite copy, so its Plugin type is
|
||||
// nominally different from the root vite's PluginOption (same 6.4.1 version).
|
||||
plugins: [react() as any],
|
||||
resolve: {
|
||||
alias: {
|
||||
'@': path.resolve(__dirname, 'src'),
|
||||
|
|
|
|||
|
|
@ -65,9 +65,10 @@ export function FloatingCartBar({ isFlashDelivery = false }: FlashDeliveryProps)
|
|||
0
|
||||
)
|
||||
|
||||
const freeDeliveryThreshold = isFlashDelivery
|
||||
? constsData?.flashFreeDeliveryThreshold
|
||||
: constsData?.freeDeliveryThreshold
|
||||
const freeDeliveryThreshold =
|
||||
(isFlashDelivery
|
||||
? constsData?.flashFreeDeliveryThreshold
|
||||
: constsData?.freeDeliveryThreshold) ?? 0
|
||||
const remainingForFreeDelivery = Math.max(0, freeDeliveryThreshold - totalCartValue)
|
||||
|
||||
const cartBarColor = isFlashDelivery ? '#f81260' : 'var(--brand-600, #2563eb)'
|
||||
|
|
|
|||
|
|
@ -45,8 +45,10 @@ export function PaymentAndOrderComponent({
|
|||
}, 0)
|
||||
|
||||
const deliveryCharge = useMemo(() => {
|
||||
const threshold = isFlashDelivery ? constsData?.flashFreeDeliveryThreshold : constsData?.freeDeliveryThreshold
|
||||
const charge = isFlashDelivery ? constsData?.flashDeliveryCharge : constsData?.deliveryCharge
|
||||
const threshold =
|
||||
(isFlashDelivery ? constsData?.flashFreeDeliveryThreshold : constsData?.freeDeliveryThreshold) ?? 0
|
||||
const charge =
|
||||
(isFlashDelivery ? constsData?.flashDeliveryCharge : constsData?.deliveryCharge) ?? 0
|
||||
return totalPrice < threshold ? charge : 0
|
||||
}, [totalPrice, constsData, isFlashDelivery])
|
||||
|
||||
|
|
@ -231,9 +233,10 @@ export function PaymentAndOrderComponent({
|
|||
|
||||
{/* Free Delivery Nudge */}
|
||||
{deliveryCharge > 0 && (() => {
|
||||
const threshold = isFlashDelivery
|
||||
? constsData?.flashFreeDeliveryThreshold
|
||||
: constsData?.freeDeliveryThreshold
|
||||
const threshold =
|
||||
(isFlashDelivery
|
||||
? constsData?.flashFreeDeliveryThreshold
|
||||
: constsData?.freeDeliveryThreshold) ?? 0
|
||||
return threshold > 0 && totalPrice < threshold ? (
|
||||
<div className="mb-2 flex items-center gap-2 rounded-lg bg-blue-50 p-2.5">
|
||||
<ShoppingBag className="h-4 w-4 text-blue-600" />
|
||||
|
|
|
|||
|
|
@ -157,7 +157,7 @@ function useCacheUrl(filename: string): string | null {
|
|||
|
||||
const assetsDomain = essentialConsts?.assetsDomain
|
||||
const apiCacheKey = essentialConsts?.apiCacheKey
|
||||
const cacheVersion = essentialConsts?.cacheVersion
|
||||
const cacheVersion = essentialConsts?.products_version_num
|
||||
|
||||
if (
|
||||
!assetsDomain ||
|
||||
|
|
@ -177,7 +177,7 @@ function useAvailabilityCacheUrl(): string | null {
|
|||
const regionId = useDiscoveryRegionId(essentialConsts)
|
||||
|
||||
const assetsDomain = essentialConsts?.assetsDomain
|
||||
const availabilityVersionNum = essentialConsts?.availabilityVersionNum
|
||||
const availabilityVersionNum = essentialConsts?.availability_version_num
|
||||
|
||||
if (!assetsDomain || availabilityVersionNum === undefined || availabilityVersionNum === null || regionId == null) {
|
||||
return null
|
||||
|
|
@ -191,7 +191,7 @@ function useSlotsCacheUrl(): string | null {
|
|||
const regionId = useDiscoveryRegionId(essentialConsts)
|
||||
|
||||
const assetsDomain = essentialConsts?.assetsDomain
|
||||
const slotsVersionNum = essentialConsts?.slotsVersionNum
|
||||
const slotsVersionNum = essentialConsts?.slots_version_num
|
||||
|
||||
if (!assetsDomain || slotsVersionNum === undefined || slotsVersionNum === null || regionId == null) {
|
||||
return null
|
||||
|
|
@ -350,7 +350,7 @@ export function useStoreWithProducts(storeId: number) {
|
|||
|
||||
const assetsDomain = essentialConsts?.assetsDomain
|
||||
const apiCacheKey = essentialConsts?.apiCacheKey
|
||||
const cacheVersion = essentialConsts?.cacheVersion
|
||||
const cacheVersion = essentialConsts?.products_version_num
|
||||
|
||||
const cacheUrl =
|
||||
assetsDomain && apiCacheKey && regionId != null
|
||||
|
|
|
|||
|
|
@ -4325,3 +4325,57 @@ user-ui
|
|||
- tests: user-ui + backend coupon payloads -> couponIds.
|
||||
Deferred: superadmin-ui screen for global coupons (router is live; no UI route yet).
|
||||
Not run: any test suite. No drizzle migration executed.
|
||||
|
||||
[2026-10-11 09:38:30 +0530] Fix pre-existing type errors in web-ui + fallback-ui (db_helper_postgres left untouched).
|
||||
|
||||
--- a/apps/web-ui/src/hooks/prominent-api-hooks.ts
|
||||
+++ b/apps/web-ui/src/hooks/prominent-api-hooks.ts
|
||||
@@ useCacheUrl / useStoreWithProducts
|
||||
- const cacheVersion = essentialConsts?.cacheVersion
|
||||
+ const cacheVersion = essentialConsts?.products_version_num
|
||||
@@ useAvailabilityCacheUrl
|
||||
- const availabilityVersionNum = essentialConsts?.availabilityVersionNum
|
||||
+ const availabilityVersionNum = essentialConsts?.availability_version_num
|
||||
@@ useSlotsCacheUrl
|
||||
- const slotsVersionNum = essentialConsts?.slotsVersionNum
|
||||
+ const slotsVersionNum = essentialConsts?.slots_version_num
|
||||
|
||||
--- a/apps/web-ui/src/components/FloatingCartBar.tsx
|
||||
+++ b/apps/web-ui/src/components/FloatingCartBar.tsx
|
||||
@@
|
||||
- const freeDeliveryThreshold = isFlashDelivery
|
||||
- ? constsData?.flashFreeDeliveryThreshold
|
||||
- : constsData?.freeDeliveryThreshold
|
||||
+ const freeDeliveryThreshold =
|
||||
+ (isFlashDelivery
|
||||
+ ? constsData?.flashFreeDeliveryThreshold
|
||||
+ : constsData?.freeDeliveryThreshold) ?? 0
|
||||
|
||||
--- a/apps/web-ui/src/components/PaymentAndOrderComponent.tsx
|
||||
+++ b/apps/web-ui/src/components/PaymentAndOrderComponent.tsx
|
||||
@@
|
||||
- const threshold = isFlashDelivery ? constsData?.flashFreeDeliveryThreshold : constsData?.freeDeliveryThreshold
|
||||
- const charge = isFlashDelivery ? constsData?.flashDeliveryCharge : constsData?.deliveryCharge
|
||||
+ const threshold =
|
||||
+ (isFlashDelivery ? constsData?.flashFreeDeliveryThreshold : constsData?.freeDeliveryThreshold) ?? 0
|
||||
+ const charge =
|
||||
+ (isFlashDelivery ? constsData?.flashDeliveryCharge : constsData?.deliveryCharge) ?? 0
|
||||
@@
|
||||
- const threshold = isFlashDelivery
|
||||
- ? constsData?.flashFreeDeliveryThreshold
|
||||
- : constsData?.freeDeliveryThreshold
|
||||
+ const threshold =
|
||||
+ (isFlashDelivery
|
||||
+ ? constsData?.flashFreeDeliveryThreshold
|
||||
+ : constsData?.freeDeliveryThreshold) ?? 0
|
||||
|
||||
--- a/apps/fallback-ui/vite.config.ts
|
||||
+++ b/apps/fallback-ui/vite.config.ts
|
||||
@@
|
||||
- plugins: [react()],
|
||||
+ // @vitejs/plugin-react-swc ships its own vite copy, so its Plugin type is
|
||||
+ // nominally different from the root vite's PluginOption (same 6.4.1 version).
|
||||
+ plugins: [react() as any],
|
||||
|
||||
[2026-10-11 09:41:10 +0530] DONE — all workspaces typecheck clean except db_helper_postgres (left untouched, 47 pre-existing errors).
|
||||
web-ui (12) + fallback-ui (1) fixed. No tests run. No migration run.
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue