diff --git a/apps/docs/components/Feedback/Feedback.tsx b/apps/docs/components/Feedback/Feedback.tsx index 1788f007ea6..2ec626559db 100644 --- a/apps/docs/components/Feedback/Feedback.tsx +++ b/apps/docs/components/Feedback/Feedback.tsx @@ -8,6 +8,7 @@ import { Bug, Check, MessageSquareQuote, ThumbsDown, ThumbsUp, X } from 'lucide- import { usePathname } from 'next/navigation' import { forwardRef, + useId, useReducer, useRef, useState, @@ -95,6 +96,7 @@ function Feedback({ className, variant = 'default' }: FeedbackProps) { const pathname = usePathname() ?? '' const sendTelemetryEvent = useSendTelemetryEvent() const isRail = variant === 'rail' + const titleId = useId() const supabaseUrl = process.env.NEXT_PUBLIC_SUPABASE_URL const supabaseAnonKey = process.env.NEXT_PUBLIC_SUPABASE_ANON_KEY const supabase = useConstant(() => @@ -157,9 +159,9 @@ function Feedback({ className, variant = 'default' }: FeedbackProps) { } return ( -
+

Is this helpful? diff --git a/apps/docs/components/GuidesSidebar.legacy.tsx b/apps/docs/components/GuidesSidebar.legacy.tsx index b9daa1dbf1d..3ea3f064967 100644 --- a/apps/docs/components/GuidesSidebar.legacy.tsx +++ b/apps/docs/components/GuidesSidebar.legacy.tsx @@ -4,6 +4,7 @@ import { AiTools } from '~/components/AiTools' import { Feedback } from '~/components/Feedback' import { VideoPreview } from '~/components/VideoPreview' +import { LayoutSwitchButton } from '~/features/DocsLayout/LayoutSwitchButton' import { isFeatureEnabled } from 'common' import { usePathname } from 'next/navigation' import { cn } from 'ui' @@ -59,6 +60,7 @@ const GuidesSidebar = ({ {!hideToc && toc.length !== 0 && ( )} + ) diff --git a/apps/docs/components/GuidesSidebar.tsx b/apps/docs/components/GuidesSidebar.tsx index 70e0ebd128e..8ca79602605 100644 --- a/apps/docs/components/GuidesSidebar.tsx +++ b/apps/docs/components/GuidesSidebar.tsx @@ -3,6 +3,7 @@ import { Feedback } from '~/components/Feedback' import { LegacyGuidesSidebar } from '~/components/GuidesSidebar.legacy' import { VideoPreview } from '~/components/VideoPreview' +import { LayoutSwitchButton } from '~/features/DocsLayout/LayoutSwitchButton' import { useDocsLayoutV2 } from '~/features/DocsLayout/useDocsLayoutV2' import { HeadingSlotCrumb } from '~/layouts/HeadingSlot' import { RightRailPortal } from '~/layouts/RightRail' @@ -37,6 +38,11 @@ interface GuidesSidebarProps extends GuidesRightRailProps { className?: string } +interface GuidePageLinksProps { + editHref?: string + className?: string +} + interface GuideTocProps { toc: TOCItemType[] activeUrl: string | undefined @@ -58,15 +64,10 @@ const GuidesSidebar = ({ className, ...props }: GuidesSidebarProps) => const GuidesRightRail = ({ video, videoTitle, hideToc, editHref }: GuidesRightRailProps) => { const pathname = usePathname() - const sendTelemetryEvent = useSendTelemetryEvent() const { toc } = useTocAnchors() const activeIndex = Math.max(TocPrimitive.useTopActiveIndex(toc), 0) - const showFeedback = isFeatureEnabled('feedback:docs') const tocVideoPreview = `https://img.youtube.com/vi/${video}/0.jpg` - const handlePreferredSourceClick = () => - sendTelemetryEvent({ action: 'preferred_source_clicked', properties: { pageType: 'guide' } }) - return (
@@ -83,51 +84,66 @@ const GuidesRightRail = ({ video, videoTitle, hideToc, editHref }: GuidesRightRa )}
+
) } +const GuidePageLinks = ({ editHref, className }: GuidePageLinksProps) => { + const pathname = usePathname() + const sendTelemetryEvent = useSendTelemetryEvent() + const showFeedback = isFeatureEnabled('feedback:docs') + + const handlePreferredSourceClick = () => + sendTelemetryEvent({ action: 'preferred_source_clicked', properties: { pageType: 'guide' } }) + + return ( + + ) +} + const GuideToc = ({ toc, activeUrl }: GuideTocProps) => (