mirror of
https://github.com/hwchase17/langchain.git
synced 2025-08-17 16:39:52 +00:00
docs: gh feedback link (#21606)
Co-authored-by: bracesproul <braceasproul@gmail.com>
This commit is contained in:
parent
506df439eb
commit
752b1e85f8
@ -112,6 +112,7 @@ export default function Feedback() {
|
|||||||
const { setCookie, checkCookie } = useCookie();
|
const { setCookie, checkCookie } = useCookie();
|
||||||
const [feedbackSent, setFeedbackSent] = useState(false);
|
const [feedbackSent, setFeedbackSent] = useState(false);
|
||||||
const { siteConfig } = useDocusaurusContext();
|
const { siteConfig } = useDocusaurusContext();
|
||||||
|
const [pathname, setPathname] = useState("");
|
||||||
|
|
||||||
/** @param {"good" | "bad"} feedback */
|
/** @param {"good" | "bad"} feedback */
|
||||||
const handleFeedback = async (feedback) => {
|
const handleFeedback = async (feedback) => {
|
||||||
@ -167,6 +168,7 @@ export default function Feedback() {
|
|||||||
// (cookies exp in 24hrs)
|
// (cookies exp in 24hrs)
|
||||||
const cookieName = `${FEEDBACK_COOKIE_PREFIX}_${window.location.pathname}`;
|
const cookieName = `${FEEDBACK_COOKIE_PREFIX}_${window.location.pathname}`;
|
||||||
setFeedbackSent(checkCookie(cookieName));
|
setFeedbackSent(checkCookie(cookieName));
|
||||||
|
setPathname(window.location.pathname);
|
||||||
}
|
}
|
||||||
}, []);
|
}, []);
|
||||||
|
|
||||||
@ -192,6 +194,10 @@ export default function Feedback() {
|
|||||||
onMouseUp: (e) => (e.currentTarget.style.backgroundColor = "#f0f0f0"),
|
onMouseUp: (e) => (e.currentTarget.style.backgroundColor = "#f0f0f0"),
|
||||||
};
|
};
|
||||||
|
|
||||||
|
const newGithubIssueURL = pathname
|
||||||
|
? `https://github.com/langchain-ai/langchain/issues/new?assignees=&labels=03+-+Documentation&projects=&template=documentation.yml&title=DOC%3A+%3CIssue+related+to+${pathname}%3E`
|
||||||
|
: "https://github.com/langchain-ai/langchain/issues/new?assignees=&labels=03+-+Documentation&projects=&template=documentation.yml&title=DOC%3A+%3CPlease+write+a+comprehensive+title+after+the+%27DOC%3A+%27+prefix%3E";
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div style={{ display: "flex", flexDirection: "column" }}>
|
<div style={{ display: "flex", flexDirection: "column" }}>
|
||||||
<hr />
|
<hr />
|
||||||
@ -199,7 +205,7 @@ export default function Feedback() {
|
|||||||
<h4>Thanks for your feedback!</h4>
|
<h4>Thanks for your feedback!</h4>
|
||||||
) : (
|
) : (
|
||||||
<>
|
<>
|
||||||
<h4>Help us out by providing feedback on this documentation page:</h4>
|
<h4>Was this page helpful?</h4>
|
||||||
<div style={{ display: "flex", gap: "5px" }}>
|
<div style={{ display: "flex", gap: "5px" }}>
|
||||||
<div
|
<div
|
||||||
{...defaultFields}
|
{...defaultFields}
|
||||||
@ -240,6 +246,14 @@ export default function Feedback() {
|
|||||||
</div>
|
</div>
|
||||||
</>
|
</>
|
||||||
)}
|
)}
|
||||||
|
<br />
|
||||||
|
<h4>
|
||||||
|
You can leave detailed feedback{" "}
|
||||||
|
<a target="_blank" href={newGithubIssueURL}>
|
||||||
|
on GitHub
|
||||||
|
</a>
|
||||||
|
.
|
||||||
|
</h4>
|
||||||
</div>
|
</div>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user