docs: change report issue link (#10160)

This commit is contained in:
Shahed Nasser
2024-11-19 15:54:16 +02:00
committed by GitHub
parent 156494c646
commit a1738f823c
23 changed files with 40 additions and 190 deletions
@@ -3,11 +3,8 @@
import {
Feedback as UiFeedback,
FeedbackProps as UiFeedbackProps,
formatReportLink,
useIsBrowser,
} from "docs-ui"
import { usePathname } from "next/navigation"
import { config } from "../../config"
import { useMemo } from "react"
import { basePathUrl } from "../../utils/base-path-url"
@@ -15,23 +12,13 @@ type FeedbackProps = Omit<UiFeedbackProps, "event" | "pathName">
export const Feedback = (props: FeedbackProps) => {
const pathname = usePathname()
const { isBrowser } = useIsBrowser()
const feedbackPathname = useMemo(() => basePathUrl(pathname), [pathname])
const reportLink = useMemo(
() =>
formatReportLink(
config.titleSuffix || "",
isBrowser ? document.title : ""
),
[isBrowser]
)
return (
<UiFeedback
event="survey"
pathName={feedbackPathname}
reportLink={reportLink}
question="Was this page helpful?"
{...props}
/>