From 32c612a10d9d239ff2fda4c2aa520f2d353814b7 Mon Sep 17 00:00:00 2001 From: abhishek Date: Wed, 9 Sep 2026 11:19:05 +0530 Subject: [PATCH] qr code --- .../nearle-admin/pages/OnboardTenantPage.tsx | 22 +++ .../nearle-admin/pages/StoreDetailPage.tsx | 45 ++++- src/features/qr/StoreQrPanel.tsx | 163 ++++++++++++++++++ src/features/{store-user => qr}/qr.test.ts | 39 +++++ src/features/{store-user => qr}/qr.ts | 0 src/features/store-admin/StoreAdminShell.tsx | 47 ++++- .../store-admin/pages/OnboardBranchPage.tsx | 17 ++ src/features/store-user/StoreQrDrawer.tsx | 129 ++------------ 8 files changed, 335 insertions(+), 127 deletions(-) create mode 100644 src/features/qr/StoreQrPanel.tsx rename src/features/{store-user => qr}/qr.test.ts (66%) rename src/features/{store-user => qr}/qr.ts (100%) diff --git a/src/features/nearle-admin/pages/OnboardTenantPage.tsx b/src/features/nearle-admin/pages/OnboardTenantPage.tsx index b13a955..f3ca1cc 100644 --- a/src/features/nearle-admin/pages/OnboardTenantPage.tsx +++ b/src/features/nearle-admin/pages/OnboardTenantPage.tsx @@ -15,6 +15,7 @@ import { PageBody } from '@/components/PageBody'; import { PageHeader } from '@/components/PageHeader'; import { SectionHeader } from '@/components/SectionHeader'; import { queryKeys } from '@/queries/keys'; +import { StoreQrPanel } from '@/features/qr/StoreQrPanel'; import { useAppCategories } from '@/queries/hooks'; interface FormState { @@ -149,6 +150,27 @@ export function OnboardTenantPage() { stocking the catalogue — pick products from the global catalogue, or upload the tenant's own list as a spreadsheet. + + {/* The storefront code, at the one moment the person who provisioned + the shop is holding its details. + + It was reachable only from the branch user's own header, which + is the wrong place for it: the code is what puts the store in + front of a shopper at all — nobody can order from a shop they + have not scanned — and the person onboarding it is the one who + sends it to the merchant. `createtenantuser` returns the tenant + and its primary outlet's id together, so it can be drawn here + without a second read. */} + {created?.tenantid && created?.locationid ? ( + + + + ) : null}