feat(medusa,dashboard,admin-sdk): Run admin dashboard from Medusa instance (#7330)
This commit is contained in:
@@ -1,16 +1,18 @@
|
||||
import { RouteObject } from "react-router-dom"
|
||||
|
||||
import routes from "medusa-admin:routes/pages"
|
||||
// import routes from "medusa-admin:routes/pages"
|
||||
|
||||
export const RouteExtensions: RouteObject[] = []
|
||||
|
||||
/**
|
||||
* UI Route extensions.
|
||||
*/
|
||||
export const RouteExtensions: RouteObject[] = routes.pages.map((ext) => {
|
||||
return {
|
||||
path: ext.path,
|
||||
async lazy() {
|
||||
const { default: Component } = await import(/* @vite-ignore */ ext.file)
|
||||
return { Component }
|
||||
},
|
||||
}
|
||||
})
|
||||
// export const RouteExtensions: RouteObject[] = routes.pages.map((ext) => {
|
||||
// return {
|
||||
// path: ext.path,
|
||||
// async lazy() {
|
||||
// const { default: Component } = await import(/* @vite-ignore */ ext.file)
|
||||
// return { Component }
|
||||
// },
|
||||
// }
|
||||
// })
|
||||
|
||||
@@ -15,9 +15,9 @@ import {
|
||||
import { Outlet, RouteObject } from "react-router-dom"
|
||||
|
||||
import { ProtectedRoute } from "../../components/authentication/protected-route"
|
||||
import { ErrorBoundary } from "../../components/error/error-boundary"
|
||||
import { MainLayout } from "../../components/layout/main-layout"
|
||||
import { SettingsLayout } from "../../components/layout/settings-layout"
|
||||
import { ErrorBoundary } from "../../components/utilities/error-boundary"
|
||||
import { InventoryItemRes, PriceListRes } from "../../types/api-responses"
|
||||
|
||||
import { RouteExtensions } from "./route-extensions"
|
||||
|
||||
@@ -5,7 +5,9 @@ import {
|
||||
|
||||
import { RouteMap } from "./route-map"
|
||||
|
||||
const router = createBrowserRouter(RouteMap)
|
||||
const router = createBrowserRouter(RouteMap, {
|
||||
basename: __BASE__ || "/",
|
||||
})
|
||||
|
||||
export const RouterProvider = () => {
|
||||
return <Provider router={router} />
|
||||
|
||||
+14
-10
@@ -1,15 +1,19 @@
|
||||
import settings from "medusa-admin:settings/pages"
|
||||
import { RouteObject } from "react-router-dom"
|
||||
|
||||
// import settings from "medusa-admin:settings/pages"
|
||||
|
||||
/**
|
||||
* UI Settings extensions.
|
||||
*/
|
||||
export const SettingsExtensions: RouteObject[] = settings.pages.map((ext) => {
|
||||
return {
|
||||
path: `/settings${ext.path}`,
|
||||
async lazy() {
|
||||
const { default: Component } = await import(/* @vite-ignore */ ext.file)
|
||||
return { Component }
|
||||
},
|
||||
}
|
||||
})
|
||||
|
||||
export const SettingsExtensions: RouteObject[] = []
|
||||
|
||||
// export const SettingsExtensions: RouteObject[] = settings.pages.map((ext) => {
|
||||
// return {
|
||||
// path: `/settings${ext.path}`,
|
||||
// async lazy() {
|
||||
// const { default: Component } = await import(/* @vite-ignore */ ext.file)
|
||||
// return { Component }
|
||||
// },
|
||||
// }
|
||||
// })
|
||||
|
||||
Reference in New Issue
Block a user