From bd40ed603f2a3179347c9ce078fcb9ec520fa478 Mon Sep 17 00:00:00 2001 From: Kien Ngo Date: Sat, 27 Jul 2024 07:38:04 -0400 Subject: [PATCH] Revert "removed-context (#519)" This reverts commit efaa33efc4a610618a0373d1385b241c59a2886f. --- src/app/Header.tsx | 5 ++ src/app/layout.tsx | 8 ++++ src/components/others/ContextAIButton.tsx | 56 +++++++++++++++++++++++ 3 files changed, 69 insertions(+) create mode 100644 src/components/others/ContextAIButton.tsx diff --git a/src/app/Header.tsx b/src/app/Header.tsx index e2c81e75..f0300708 100644 --- a/src/app/Header.tsx +++ b/src/app/Header.tsx @@ -14,6 +14,7 @@ import { } from "@/components/ui/dropdown-menu"; import { useState } from "react"; import { DocSearch } from "@/components/others/DocSearch"; +import { ContextAIBotButton } from "@/components/others/ContextAIButton"; import { ThemeSwitcher } from "../components/others/theme/ThemeSwitcher"; import { ThirdwebIcon } from "../icons/thirdweb"; import { FaGithub } from "react-icons/fa"; @@ -190,6 +191,10 @@ export function Header() { +
+ +
+
diff --git a/src/app/layout.tsx b/src/app/layout.tsx index 135a509b..1570dcc1 100644 --- a/src/app/layout.tsx +++ b/src/app/layout.tsx @@ -3,6 +3,10 @@ import { Inter, Fira_Code } from "next/font/google"; import { Header } from "./Header"; import NextTopLoader from "nextjs-toploader"; import { PosthogHeadSetup, PosthogPageView } from "@/lib/posthog/Posthog"; +import { + ContextAIBotButton, + ContextAIBotScript, +} from "@/components/others/ContextAIButton"; import Script from "next/script"; import { createMetadata } from "@/components/Document"; import { SetStoredTheme } from "../components/others/theme/theme"; @@ -46,6 +50,7 @@ export default function RootLayout({ data-domain="portal.thirdweb.com" data-api="https://pl.thirdweb.com/api/event" /> + +
+ +
diff --git a/src/components/others/ContextAIButton.tsx b/src/components/others/ContextAIButton.tsx new file mode 100644 index 00000000..6bf99755 --- /dev/null +++ b/src/components/others/ContextAIButton.tsx @@ -0,0 +1,56 @@ +"use client"; + +import React from "react"; +import Script from "next/script"; +import { Button } from "../ui/button"; +import posthog from "posthog-js"; + +const contextBotId = "SV3HwtSN0"; + +export function ContextAIBotButton() { + const handleClick = () => { + posthog.capture("ai-bot.click"); + }; + + return ( + // eslint-disable-next-line svg-jsx/camel-case-dash +
+ +
+ ); +} + +export function ContextAIBotScript() { + return ( + + ); +} + +function StarsIcon() { + return ( + + + + ); +}