chore: reorganize docs apps (#7228)
* reorganize docs apps * add README * fix directory * add condition for old docs
This commit is contained in:
1 parent
224ebb2154
commit
4fe28f5a95
6187 files changed
+601447
-598226
No files matched your search
@@ -0,0 +1,19 @@
|
||||
"use client"
|
||||
|
||||
import { EditButton as UiEditButton } from "docs-ui"
|
||||
import { usePathname } from "next/navigation"
|
||||
|
||||
const EditButton = () => {
|
||||
const pathname = usePathname()
|
||||
|
||||
return (
|
||||
<UiEditButton
|
||||
filePath={`/www/apps/user-guide/app${pathname.replace(
|
||||
/\/$/,
|
||||
""
|
||||
)}/page.mdx`}
|
||||
/>
|
||||
)
|
||||
}
|
||||
|
||||
export default EditButton
|
||||
@@ -0,0 +1,30 @@
|
||||
"use client"
|
||||
|
||||
import {
|
||||
Feedback as UiFeedback,
|
||||
FeedbackProps as UiFeedbackProps,
|
||||
formatReportLink,
|
||||
} from "docs-ui"
|
||||
import { usePathname } from "next/navigation"
|
||||
import { config } from "../../config"
|
||||
|
||||
type FeedbackProps = Omit<UiFeedbackProps, "event" | "pathName">
|
||||
|
||||
const Feedback = (props: FeedbackProps) => {
|
||||
const pathname = usePathname()
|
||||
|
||||
return (
|
||||
<UiFeedback
|
||||
event="survey"
|
||||
pathName={pathname}
|
||||
reportLink={formatReportLink(
|
||||
config.titleSuffix || "",
|
||||
typeof document !== "undefined" ? document.title : ""
|
||||
)}
|
||||
question="Was this chapter helpful?"
|
||||
{...props}
|
||||
/>
|
||||
)
|
||||
}
|
||||
|
||||
export default Feedback
|
||||
@@ -0,0 +1,16 @@
|
||||
import type { MDXComponents as MDXComponentsType } from "mdx/types"
|
||||
import {
|
||||
Link,
|
||||
MDXComponents as UiMdxComponents,
|
||||
InlineThemeImage,
|
||||
InlineIcon,
|
||||
} from "docs-ui"
|
||||
|
||||
const MDXComponents: MDXComponentsType = {
|
||||
...UiMdxComponents,
|
||||
a: Link,
|
||||
InlineThemeImage,
|
||||
InlineIcon,
|
||||
}
|
||||
|
||||
export default MDXComponents
|
||||
@@ -0,0 +1,37 @@
|
||||
"use client"
|
||||
|
||||
import { Navbar as UiNavbar, getNavbarItems } from "docs-ui"
|
||||
import { useSidebar } from "docs-ui"
|
||||
import { basePathUrl } from "../../utils/base-path-url"
|
||||
import { useMemo } from "react"
|
||||
import { config } from "../../config"
|
||||
|
||||
const Navbar = () => {
|
||||
const { setMobileSidebarOpen, mobileSidebarOpen } = useSidebar()
|
||||
|
||||
const navbarItems = useMemo(
|
||||
() =>
|
||||
getNavbarItems({
|
||||
basePath: config.baseUrl,
|
||||
activePath: process.env.NEXT_PUBLIC_BASE_PATH || "/user-guide",
|
||||
}),
|
||||
[]
|
||||
)
|
||||
|
||||
return (
|
||||
<UiNavbar
|
||||
logo={{
|
||||
light: basePathUrl("/images/logo-icon.png"),
|
||||
dark: basePathUrl("/images/logo-icon-dark.png"),
|
||||
}}
|
||||
items={navbarItems}
|
||||
mobileMenuButton={{
|
||||
setMobileSidebarOpen,
|
||||
mobileSidebarOpen,
|
||||
}}
|
||||
isLoading={false}
|
||||
/>
|
||||
)
|
||||
}
|
||||
|
||||
export default Navbar
|
||||
Reference in new issue
Block a user