docs: fix expand badge (#8611)

* fix component

* update expand URL
This commit is contained in:
Shahed Nasser
2024-08-16 09:26:16 +03:00
committed by GitHub
parent 47eb19ca5d
commit 5abe9f9c66
4 changed files with 11 additions and 9 deletions

View File

@@ -2,7 +2,7 @@ import React from "react"
import { Badge, Link, Tooltip } from "@/components"
export type ExpandableNoticeProps = {
type: "request" | "method"
type: "request" | "method" | "workflow"
link: string
badgeContent?: React.ReactNode
badgeClassName?: string
@@ -19,8 +19,8 @@ export const ExpandableNotice = ({
tooltipChildren={
<>
If this {type} accepts an <code>expand</code>{" "}
{type === "request" ? "parameter" : "property or option"},
<br /> this field can be <Link href={link}>expanded</Link> into an
{type === "request" ? "parameter" : "parameter or property"},
<br /> this relation can be <Link href={link}>expanded</Link> into an
object.
</>
}

View File

@@ -25,6 +25,7 @@ import { useIsBrowser, useSiteConfig } from "../../.."
type CommonProps = ParentCommonProps & {
level?: number
referenceType?: "method" | "workflow"
}
type TypeListItemProps = {
@@ -39,6 +40,7 @@ const TypeListItem = ({
expandUrl,
elementKey,
sectionTitle,
referenceType = "method",
}: TypeListItemProps) => {
const isBrowser = useIsBrowser()
const pathname = usePathname()
@@ -227,9 +229,9 @@ const TypeListItem = ({
)}
{item.expandable && (
<ExpandableNotice
type="method"
type={referenceType}
link={expandUrl || "#"}
badgeClassName="!p-0 leading-none"
badgeClassName="!p-docs_0.25 block leading-none"
badgeContent={<ArrowsPointingOutMini />}
/>
)}