From 6d1c3e1a12be1b0f839c878a38c1b20dc1ef9c09 Mon Sep 17 00:00:00 2001 From: paanSinghCoder Date: Wed, 13 May 2026 17:05:56 +0530 Subject: [PATCH 1/2] fix(admin): lift Drawer open state to parent so mount animation fires --- .../organizations/details/edit/billing.tsx | 5 ++-- .../views/organizations/details/edit/kyc.tsx | 5 ++-- .../details/edit/organization.tsx | 4 ++-- .../organizations/details/layout/index.tsx | 10 +++----- .../admin/views/organizations/list/create.tsx | 4 +++- .../admin/views/organizations/list/index.tsx | 23 +++++++++---------- web/sdk/admin/views/products/details.tsx | 12 +++++++--- web/sdk/admin/views/products/index.tsx | 13 +++++------ .../views/webhooks/webhooks/create/index.tsx | 5 ++-- .../admin/views/webhooks/webhooks/index.tsx | 13 +++++------ .../views/webhooks/webhooks/update/index.tsx | 5 ++-- 11 files changed, 52 insertions(+), 47 deletions(-) diff --git a/web/sdk/admin/views/organizations/details/edit/billing.tsx b/web/sdk/admin/views/organizations/details/edit/billing.tsx index 24bf5d16f..34decae5e 100644 --- a/web/sdk/admin/views/organizations/details/edit/billing.tsx +++ b/web/sdk/admin/views/organizations/details/edit/billing.tsx @@ -26,6 +26,7 @@ import { import { create } from "@bufbuild/protobuf"; interface EditBillingPanelProps { + open?: boolean; onClose: () => void; } @@ -70,7 +71,7 @@ const billingDetailsUpdateSchema = z type BillingDetailsForm = z.infer; -export function EditBillingPanel({ onClose }: EditBillingPanelProps) { +export function EditBillingPanel({ open = false, onClose }: EditBillingPanelProps) { const { billingAccount, billingAccountDetails, @@ -174,7 +175,7 @@ export function EditBillingPanel({ onClose }: EditBillingPanelProps) { const isPrepaid = tokenPaymentType === "prepaid"; return ( - + void; } @@ -44,7 +45,7 @@ const kycUpdateSchema = z type KYCUpdateSchema = z.infer; -export function EditKYCPanel({ onClose }: EditKYCPanelProps) { +export function EditKYCPanel({ open = false, onClose }: EditKYCPanelProps) { const { organization, kycDetails, updateKYCDetails } = useContext(OrganizationContext); const queryClient = useQueryClient(); const transport = useTransport(); @@ -104,7 +105,7 @@ export function EditKYCPanel({ onClose }: EditKYCPanelProps) { } return ( - + void }) { +export function EditOrganizationPanel({ open = false, onClose }: { open?: boolean; onClose: () => void }) { const t = useTerminology(); const { organization, appUrl, countries: countriesFromContext = [], organizationTypes: industries = [] } = useContext(OrganizationContext); const [countries, setCountries] = useState(countriesFromContext); @@ -160,7 +160,7 @@ export function EditOrganizationPanel({ onClose }: { onClose: () => void }) { const showOtherTypeField = watch("type", "other") === "other"; return ( - + {children} - {showKYCPanel ? : null} + {showSidePanel ? : null} - {showEditOrgPanel ? ( - - ) : null} - {showEditBillingPanel ? ( - - ) : null} + + ) : ( diff --git a/web/sdk/admin/views/organizations/list/create.tsx b/web/sdk/admin/views/organizations/list/create.tsx index 11ffa851e..a6d4b2af1 100644 --- a/web/sdk/admin/views/organizations/list/create.tsx +++ b/web/sdk/admin/views/organizations/list/create.tsx @@ -46,6 +46,7 @@ type OrgCreateSchema = z.infer; const otherTypePrefix = "Other - "; export type CreateOrganizationPanelProps = { + open?: boolean; onClose: () => void; organizationTypes?: string[]; appUrl?: string; @@ -54,6 +55,7 @@ export type CreateOrganizationPanelProps = { }; export function CreateOrganizationPanel({ + open = false, onClose, organizationTypes = [], appUrl = "", @@ -127,7 +129,7 @@ export function CreateOrganizationPanel({ const showOtherTypeField = watch("type", "other") === "other"; return ( - + - {showCreatePanel ? ( - { - closeCreateOrgPanel(); - onNavigateToOrg?.(id); - }} - /> - ) : null} + { + closeCreateOrgPanel(); + onNavigateToOrg?.(id); + }} + /> void; onNavigateToPrices: (productId: string) => void; }; export default function ProductDetails({ product, + open = false, onClose, onNavigateToPrices, }: ProductDetailsProps) { return ( - + - + {product?.title} diff --git a/web/sdk/admin/views/products/index.tsx b/web/sdk/admin/views/products/index.tsx index a2ee1bb1f..92e19ca2f 100644 --- a/web/sdk/admin/views/products/index.tsx +++ b/web/sdk/admin/views/products/index.tsx @@ -83,13 +83,12 @@ export default function ProductsView({ emptyState={noDataChildren} classNames={{ root: styles.tableRoot }} /> - {product && ( - {})} - onNavigateToPrices={onNavigateToPrices ?? (() => {})} - /> - )} + {})} + onNavigateToPrices={onNavigateToPrices ?? (() => {})} + /> diff --git a/web/sdk/admin/views/webhooks/webhooks/create/index.tsx b/web/sdk/admin/views/webhooks/webhooks/create/index.tsx index 0062ef87e..c04bf854c 100644 --- a/web/sdk/admin/views/webhooks/webhooks/create/index.tsx +++ b/web/sdk/admin/views/webhooks/webhooks/create/index.tsx @@ -30,10 +30,11 @@ const NewWebookSchema = z.object({ export type NewWebhook = z.infer; export type CreateWebhooksProps = { + open?: boolean; onClose?: () => void; }; -export default function CreateWebhooks({ onClose: onCloseProp }: CreateWebhooksProps = {}) { +export default function CreateWebhooks({ open = false, onClose: onCloseProp }: CreateWebhooksProps = {}) { const { invalidateWebhooksList } = useWebhookQueries(); const onOpenChange = useCallback(() => { @@ -73,7 +74,7 @@ export default function CreateWebhooks({ onClose: onCloseProp }: CreateWebhooksP }; return ( - + - {createOpen && } - {selectedWebhookId && ( - - )} + + ); } diff --git a/web/sdk/admin/views/webhooks/webhooks/update/index.tsx b/web/sdk/admin/views/webhooks/webhooks/update/index.tsx index 5cdecd122..41bcebeaa 100644 --- a/web/sdk/admin/views/webhooks/webhooks/update/index.tsx +++ b/web/sdk/admin/views/webhooks/webhooks/update/index.tsx @@ -30,11 +30,12 @@ const UpdateWebhookSchema = z.object({ export type UpdateWebhook = z.infer; export type UpdateWebhooksProps = { + open?: boolean; webhookId?: string; onClose?: () => void; }; -export default function UpdateWebhooks({ webhookId: webhookIdProp, onClose: onCloseProp }: UpdateWebhooksProps = {}) { +export default function UpdateWebhooks({ open = false, webhookId: webhookIdProp, onClose: onCloseProp }: UpdateWebhooksProps = {}) { const webhookId = webhookIdProp ?? ""; const { @@ -100,7 +101,7 @@ export default function UpdateWebhooks({ webhookId: webhookIdProp, onClose: onCl }, [webhook, methods.reset]); return ( - + Date: Fri, 15 May 2026 16:28:51 +0530 Subject: [PATCH 2/2] fix(admin): update Drawer component to handle open state change for better close behavior --- web/sdk/admin/views/organizations/details/edit/billing.tsx | 2 +- web/sdk/admin/views/organizations/details/edit/kyc.tsx | 2 +- web/sdk/admin/views/organizations/details/edit/organization.tsx | 2 +- web/sdk/admin/views/organizations/list/create.tsx | 2 +- web/sdk/admin/views/products/details.tsx | 2 +- web/sdk/admin/views/webhooks/webhooks/create/index.tsx | 2 +- web/sdk/admin/views/webhooks/webhooks/update/index.tsx | 2 +- 7 files changed, 7 insertions(+), 7 deletions(-) diff --git a/web/sdk/admin/views/organizations/details/edit/billing.tsx b/web/sdk/admin/views/organizations/details/edit/billing.tsx index 34decae5e..fa477fa63 100644 --- a/web/sdk/admin/views/organizations/details/edit/billing.tsx +++ b/web/sdk/admin/views/organizations/details/edit/billing.tsx @@ -175,7 +175,7 @@ export function EditBillingPanel({ open = false, onClose }: EditBillingPanelProp const isPrepaid = tokenPaymentType === "prepaid"; return ( - + !open && onClose()}> + !open && onClose()}> + !open && onClose()}> + !open && onClose()}> + !open && onClose()}> + !open && onCloseProp?.()}> + !open && onClose()}>