Skip to content

Commit

Permalink
feat: Cookbook Onboard integration
Browse files Browse the repository at this point in the history
fix
  • Loading branch information
ClockRide committed Jul 30, 2024
1 parent f7a7863 commit 65d2e06
Show file tree
Hide file tree
Showing 5 changed files with 1,774 additions and 36 deletions.
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
"analyze": "ANALYZE=true next build"
},
"dependencies": {
"@cookbookdev/docsbot": "^4.21.5",
"@emotion/cache": "11.11.0",
"@emotion/react": "11.11.3",
"@emotion/serialize": "1.1.3",
Expand Down
10 changes: 10 additions & 0 deletions src/components/shared/components/AskCookbook.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
import dynamic from "next/dynamic";
const BaseAskCookbook = dynamic(() => import("@cookbookdev/docsbot/react-fixed"), { ssr: false });

/** It's going to be exposed in HTTP requests anyway so it's fine to just hardcode it here */
const COOKBOOK_PUBLIC_API_KEY =
"eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiI2NWNhYjFkMjU4OGEwOTU1ZDNjYWU2ZmYiLCJpYXQiOjE3MDc3ODI2MTAsImV4cCI6MjAyMzM1ODYxMH0.CxSlf6zY94GhJ93UPvw3_btAcDODHOP0MjmMEZuqb1M";

export const AskCookbook = () => {
return <BaseAskCookbook apiKey={COOKBOOK_PUBLIC_API_KEY} />;
};
2 changes: 2 additions & 0 deletions src/pages/_app.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import type { AppProps } from "next/app";
import Script from "next/script";

import { HeadProgressBar, Layout } from "~/components/shared";
import { AskCookbook } from "~/components/shared/components/AskCookbook";
import { environment } from "~/env.cjs";
import { useAppAnalytics } from "~/hooks/useAppAnalytics";
import { useAppDispatch, wrapper } from "~/lib/app.store";
Expand Down Expand Up @@ -55,6 +56,7 @@ const App = ({ Component, pageProps, ...rest }: AppProps & { emotionCache: Emoti
</Script>
</>
)}
<AskCookbook />
</>
);
};
Expand Down
4 changes: 4 additions & 0 deletions src/types/ask-cookbook.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
// Solves the following error: "Cannot find module ... or its corresponding type declarations. There are types at ..., but this result could not be resolved under your current 'moduleResolution' setting. Consider updating to 'node16', 'nodenext', or 'bundler'. [2307]"
declare module "@cookbookdev/docsbot/react-fixed" {
export { default } from "@cookbookdev/docsbot/dist/react-fixed/index.d.ts";
}
Loading

0 comments on commit 65d2e06

Please sign in to comment.