From c7e06ac59adf8c39d2d45c436c744be5342a370f Mon Sep 17 00:00:00 2001 From: Kacper Wojciechowski <39823706+jog1t@users.noreply.github.com> Date: Fri, 25 Jul 2025 00:18:54 +0200 Subject: [PATCH] feat(site): add newsleter --- site/src/app/(v2)/(marketing)/sales/form.tsx | 6 +-- site/src/components/DocsTableOfContents.tsx | 15 ++---- site/src/components/Newsletter.tsx | 50 ++++++++++++++++++++ 3 files changed, 57 insertions(+), 14 deletions(-) create mode 100644 site/src/components/Newsletter.tsx diff --git a/site/src/app/(v2)/(marketing)/sales/form.tsx b/site/src/app/(v2)/(marketing)/sales/form.tsx index 890ad90669..03d899aa13 100644 --- a/site/src/app/(v2)/(marketing)/sales/form.tsx +++ b/site/src/app/(v2)/(marketing)/sales/form.tsx @@ -12,8 +12,6 @@ export function SalesForm() { const data = Object.fromEntries(formData.entries().toArray()); - console.log(data); - posthog.capture("survey sent", { $survey_id: "0193928a-4799-0000-8fc4-455382e21359", ...data, @@ -27,8 +25,8 @@ export function SalesForm() { Thank you for your interest! - We will get back to you within the next few days. In the - meantime, feel free to explore our{" "} + We will get back to you within the next few days. In the meantime, feel + free to explore our{" "} documentation {" "} diff --git a/site/src/components/DocsTableOfContents.tsx b/site/src/components/DocsTableOfContents.tsx index 756e0c17a3..ca931bc55e 100644 --- a/site/src/components/DocsTableOfContents.tsx +++ b/site/src/components/DocsTableOfContents.tsx @@ -6,6 +6,7 @@ import { motion } from "framer-motion"; import Link from "next/link"; import { useCallback, useRef, useState } from "react"; import { useEffect } from "react"; +import { Newsletter } from "./Newsletter"; const HEADER_HEIGHT = remToPx(6.5); // const SCROLL_MARGIN = remToPx(9 /* scroll-mt-header-offset */ - HEADER_HEIGHT); @@ -30,10 +31,7 @@ function useScrollToActiveLink(currentSection) { if (linkRelativeTop + LINK_MARGIN >= containerRect.height) { // calculate the difference between the bottom of the link and the bottom of the container const bottomDifference = - linkRelativeTop + - LINK_MARGIN - - containerRect.height + - linkRect.height; + linkRelativeTop + LINK_MARGIN - containerRect.height + linkRect.height; ref.current.scrollBy(0, bottomDifference); } // if the link is above the container, scroll up by the difference in height + the height of the link itself (so it's not at the top) @@ -51,10 +49,7 @@ function useCurrentSection(tableOfContents = []) { ); const getHeadings = useCallback((tableOfContents) => { return tableOfContents - .flatMap((node) => [ - node.id, - ...node.children.map((child) => child.id), - ]) + .flatMap((node) => [node.id, ...node.children.map((child) => child.id)]) .map((id) => { const el = document.getElementById(id); if (!el) return null; @@ -62,8 +57,7 @@ function useCurrentSection(tableOfContents = []) { const style = window.getComputedStyle(el); const scrollMt = Number.parseFloat(style.scrollMarginTop); - const top = - window.scrollY + el.getBoundingClientRect().top - scrollMt; + const top = window.scrollY + el.getBoundingClientRect().top - scrollMt; return { id, top }; }) .filter((x) => x !== null); @@ -206,6 +200,7 @@ export function DocsTableOfContents({