diff --git a/web/sdk/admin/views/organizations/details/edit/billing.tsx b/web/sdk/admin/views/organizations/details/edit/billing.tsx index 24bf5d16f..fa477fa63 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 ( - + !open && onClose()}> 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 ( - + !open && onClose()}> 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 ( - + !open && onClose()}> {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..21721df5c 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 ( - + !open && onClose()}> - {showCreatePanel ? ( - { - closeCreateOrgPanel(); - onNavigateToOrg?.(id); - }} - /> - ) : null} + { + closeCreateOrgPanel(); + onNavigateToOrg?.(id); + }} + /> void; onNavigateToPrices: (productId: string) => void; }; export default function ProductDetails({ product, + open = false, onClose, onNavigateToPrices, }: ProductDetailsProps) { return ( - + !open && onClose()}> - + {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..3127492dd 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 ( - + !open && onCloseProp?.()}> - {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..0fa6d16f1 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 ( - + !open && onClose()}>