feat(dashboard,ui,types,admin-shared): Add more extension zones + pass data to widgets (#7465)
This commit is contained in:
@@ -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
|
||||
}
|
||||
@@ -0,0 +1 @@
|
||||
export * from "./extensions"
|
||||
@@ -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"
|
||||
|
||||
Reference in New Issue
Block a user