docs: intro + basic chapter fixes (#10361)
This commit is contained in:
@@ -29,6 +29,8 @@ You create a UI route in a `page.tsx` file under a sub-directory of `src/admin/r
|
||||
|
||||
For example, create the file `src/admin/routes/custom/page.tsx` with the following content:
|
||||
|
||||

|
||||
|
||||
```tsx title="src/admin/routes/custom/page.tsx"
|
||||
import { Container, Heading } from "@medusajs/ui"
|
||||
|
||||
@@ -110,6 +112,8 @@ The above example adds a new sidebar item with the label `Custom Route` and an i
|
||||
|
||||
Consider that along the UI route above at `src/admin/routes/custom/page.tsx` you create a nested UI route at `src/admin/routes/custom/nested/page.tsx` that also exports route configurations:
|
||||
|
||||

|
||||
|
||||
```tsx title="src/admin/routes/custom/nested/page.tsx"
|
||||
import { defineRouteConfig } from "@medusajs/admin-sdk"
|
||||
import { Container, Heading } from "@medusajs/ui"
|
||||
@@ -149,6 +153,8 @@ To create a page under the settings section of the admin dashboard, create a UI
|
||||
|
||||
For example, create a UI route at `src/admin/routes/settings/custom/page.tsx`:
|
||||
|
||||

|
||||
|
||||
```tsx title="src/admin/routes/settings/custom/page.tsx"
|
||||
import { defineRouteConfig } from "@medusajs/admin-sdk"
|
||||
import { Container, Heading } from "@medusajs/ui"
|
||||
@@ -180,6 +186,8 @@ A UI route can accept path parameters if the name of any of the directories in i
|
||||
|
||||
For example, create the file `src/admin/routes/custom/[id]/page.tsx` with the following content:
|
||||
|
||||

|
||||
|
||||
```tsx title="src/admin/routes/custom/[id]/page.tsx" highlights={[["5", "", "Retrieve the path parameter."], ["10", "{id}", "Show the path parameter."]]}
|
||||
import { useParams } from "react-router-dom"
|
||||
import { Container, Heading } from "@medusajs/ui"
|
||||
|
||||
@@ -29,6 +29,8 @@ You create a widget in a `.tsx` file under the `src/admin/widgets` directory. Th
|
||||
|
||||
For example, create the file `src/admin/widgets/product-widget.tsx` with the following content:
|
||||
|
||||

|
||||
|
||||
export const widgetHighlights = [
|
||||
["5", "ProductWidget", "The React component of the product widget."],
|
||||
["17", "zone", "The zone to inject the widget to."]
|
||||
|
||||
Reference in New Issue
Block a user