feat(dashboard,ui,types,admin-shared): Add more extension zones + pass data to widgets (#7465)

This commit is contained in:
Kasper Fabricius Kristensen
2024-05-27 12:47:12 +02:00
committed by GitHub
parent 0b0e210f67
commit ab2e8fcd45
19 changed files with 220 additions and 109 deletions
@@ -0,0 +1,27 @@
/**
* The props for detail widgets. All widgets that are rendered in a detail view,
* e.g. the product detail view, should implement this interface.
*
* The type of the data prop should be the same as the data that is passed to the widget.
* If the widget is rendered in the product detail view, the data prop should be of
* type AdminProduct.
*
* @example
* ```tsx
* import type { DetailWidgetProps, AdminProduct } from "@medusajs/types"
* import { defineConfig } from "@medusajs/admin-shared"
*
* const ProductWidget = ({ data }: DetailWidgetProps<AdminProduct>) => {
* return <div>{data.title}</div>
* }
*
* export const config = defineConfig({
* zone: "product.details.after",
* })
*
* export default ProductWidget
* ```
*/
export interface DetailWidgetProps<TData> {
data: TData
}
+1
View File
@@ -0,0 +1 @@
export * from "./extensions"
+2 -1
View File
@@ -1,4 +1,5 @@
export * from "./address"
// export * from "./admin"
export * from "./api-key"
export * from "./auth"
export * from "./bundles"
@@ -19,6 +20,7 @@ export * from "./joiner"
export * from "./link-modules"
export * from "./logger"
export * from "./modules-sdk"
export * from "./notification"
export * from "./order"
export * from "./payment"
export * from "./pricing"
@@ -38,4 +40,3 @@ export * from "./transaction-base"
export * from "./user"
export * from "./workflow"
export * from "./workflows"
export * from "./notification"