docs: rename admin-shared -> admin-sdk (#9008)
This commit is contained in:
@@ -17,7 +17,7 @@ export const fetchHighlights = [
|
||||
]
|
||||
|
||||
```tsx title="src/admin/widgets/product-widget.tsx" highlights={fetchHighlights}
|
||||
import { defineWidgetConfig } from "@medusajs/admin-shared"
|
||||
import { defineWidgetConfig } from "@medusajs/admin-sdk"
|
||||
import { Container } from "@medusajs/ui"
|
||||
import { useEffect, useState } from "react"
|
||||
|
||||
@@ -71,7 +71,7 @@ export const highlights = [
|
||||
]
|
||||
|
||||
```tsx title="src/admin/widgets/product-widget.tsx" highlights={highlights}
|
||||
import { defineWidgetConfig } from "@medusajs/admin-shared"
|
||||
import { defineWidgetConfig } from "@medusajs/admin-sdk"
|
||||
import { Container } from "@medusajs/ui"
|
||||
import { Link } from "react-router-dom"
|
||||
|
||||
|
||||
@@ -64,7 +64,7 @@ export const highlights = [
|
||||
]
|
||||
|
||||
```tsx title="src/admin/routes/custom/page.tsx" highlights={[["21"], ["22"], ["23"], ["24"], ["25"], ["26"]]}
|
||||
import { defineRouteConfig } from "@medusajs/admin-shared"
|
||||
import { defineRouteConfig } from "@medusajs/admin-sdk"
|
||||
import { ChatBubbleLeftRight } from "@medusajs/icons"
|
||||
import { Container } from "@medusajs/ui"
|
||||
|
||||
@@ -80,7 +80,7 @@ export const config = defineRouteConfig({
|
||||
export default CustomPage
|
||||
```
|
||||
|
||||
The configuration object is created using the `defineRouteConfig` function imported from `@medusajs/admin-shared`. It accepts the following properties:
|
||||
The configuration object is created using the `defineRouteConfig` function imported from `@medusajs/admin-sdk`. It accepts the following properties:
|
||||
|
||||
- `label`: the sidebar item’s label.
|
||||
- `icon`: an optional React component used as an icon in the sidebar.
|
||||
@@ -96,7 +96,7 @@ To create a page under the settings section of the admin dashboard, create the U
|
||||
For example:
|
||||
|
||||
```tsx title="src/admin/routes/settings/custom/page.tsx"
|
||||
import { defineRouteConfig } from "@medusajs/admin-shared"
|
||||
import { defineRouteConfig } from "@medusajs/admin-sdk"
|
||||
import { Container, Heading } from "@medusajs/ui"
|
||||
|
||||
const CustomSettingPage = () => {
|
||||
|
||||
@@ -28,7 +28,7 @@ export const widgetHighlights = [
|
||||
]
|
||||
|
||||
```tsx title="src/admin/widgets/product-widget.tsx" highlights={widgetHighlights}
|
||||
import { defineWidgetConfig } from "@medusajs/admin-shared"
|
||||
import { defineWidgetConfig } from "@medusajs/admin-sdk"
|
||||
import { Container, Heading } from "@medusajs/ui"
|
||||
|
||||
// The widget
|
||||
@@ -50,7 +50,7 @@ export default ProductWidget
|
||||
|
||||
The widget only shows the heading `Product Widget`.
|
||||
|
||||
Use the `defineWidgetConfig` function imported from `@medusajs/admin-shared` to create and export the widget's configurations. It accepts as a parameter an object with the following property:
|
||||
Use the `defineWidgetConfig` function imported from `@medusajs/admin-sdk` to create and export the widget's configurations. It accepts as a parameter an object with the following property:
|
||||
|
||||
- `zone`: A string or an array of strings, each being the name of the zone to inject the widget into.
|
||||
|
||||
@@ -89,7 +89,7 @@ export const detailHighlights = [
|
||||
]
|
||||
|
||||
```tsx title="src/admin/widgets/product-widget.tsx" highlights={detailHighlights}
|
||||
import { defineWidgetConfig } from "@medusajs/admin-shared"
|
||||
import { defineWidgetConfig } from "@medusajs/admin-sdk"
|
||||
import { Container, Heading } from "@medusajs/ui"
|
||||
import {
|
||||
DetailWidgetProps,
|
||||
|
||||
@@ -23,7 +23,7 @@ A widget is a React component that can be injected into an existing page in the
|
||||
For example, create the file `src/admin/widgets/product-widget.tsx` with the following content:
|
||||
|
||||
```tsx title="src/admin/widgets/product-widget.tsx"
|
||||
import { defineWidgetConfig } from "@medusajs/admin-shared"
|
||||
import { defineWidgetConfig } from "@medusajs/admin-sdk"
|
||||
|
||||
const ProductWidget = () => {
|
||||
return (
|
||||
|
||||
@@ -849,7 +849,7 @@ export const digitalProductPageHighlights = [
|
||||
]
|
||||
|
||||
```tsx title="src/admin/routes/digital-products/page.tsx" highlights={digitalProductPageHighlights} collapsibleLines="1-7" expandMoreLabel="Show Imports"
|
||||
import { defineRouteConfig } from "@medusajs/admin-shared"
|
||||
import { defineRouteConfig } from "@medusajs/admin-sdk"
|
||||
import { PhotoSolid } from "@medusajs/icons"
|
||||
import { Container, Heading, Table } from "@medusajs/ui"
|
||||
import { useState } from "react"
|
||||
|
||||
@@ -1139,7 +1139,7 @@ export const list1Highlights = [
|
||||
]
|
||||
|
||||
```tsx title="src/admin/routes/subscriptions/page.tsx" highlights={list1Highlights} collapsibleLines="1-7" expandMoreLabel="Show Imports"
|
||||
import { defineRouteConfig } from "@medusajs/admin-shared"
|
||||
import { defineRouteConfig } from "@medusajs/admin-sdk"
|
||||
import { ClockSolid } from "@medusajs/icons"
|
||||
import { Container, Heading, Table, Badge } from "@medusajs/ui"
|
||||
import { useState } from "react"
|
||||
|
||||
Reference in New Issue
Block a user