mirror of
https://github.com/lukevella/rallly.git
synced 2025-06-07 05:01:49 +02:00
Fix posthog issue
This commit is contained in:
parent
d441d17181
commit
9a8c3acf30
5 changed files with 9 additions and 15 deletions
|
@ -2,7 +2,7 @@ import "tailwindcss/tailwind.css";
|
||||||
import "../../style.css";
|
import "../../style.css";
|
||||||
|
|
||||||
import { defaultLocale, supportedLngs } from "@rallly/languages";
|
import { defaultLocale, supportedLngs } from "@rallly/languages";
|
||||||
import { PostHogProvider } from "@rallly/posthog/client";
|
import { posthog, PostHogProvider } from "@rallly/posthog/client";
|
||||||
import { Toaster } from "@rallly/ui/toaster";
|
import { Toaster } from "@rallly/ui/toaster";
|
||||||
import { TooltipProvider } from "@rallly/ui/tooltip";
|
import { TooltipProvider } from "@rallly/ui/tooltip";
|
||||||
import { domAnimation, LazyMotion } from "motion/react";
|
import { domAnimation, LazyMotion } from "motion/react";
|
||||||
|
@ -61,7 +61,7 @@ export default async function Root({
|
||||||
<I18nProvider locale={locale}>
|
<I18nProvider locale={locale}>
|
||||||
<TRPCProvider>
|
<TRPCProvider>
|
||||||
<LazyMotion features={domAnimation}>
|
<LazyMotion features={domAnimation}>
|
||||||
<PostHogProvider>
|
<PostHogProvider client={posthog}>
|
||||||
<PostHogPageView />
|
<PostHogPageView />
|
||||||
<TooltipProvider>
|
<TooltipProvider>
|
||||||
<UserProvider
|
<UserProvider
|
||||||
|
|
|
@ -11,8 +11,8 @@ export const UpgradeButton = ({
|
||||||
annual,
|
annual,
|
||||||
large,
|
large,
|
||||||
className,
|
className,
|
||||||
}: React.PropsWithChildren<{
|
}: React.PropsWithChildren<{
|
||||||
annual?: boolean;
|
annual?: boolean;
|
||||||
large?: boolean;
|
large?: boolean;
|
||||||
className?: string;
|
className?: string;
|
||||||
}>) => {
|
}>) => {
|
||||||
|
|
|
@ -4,7 +4,7 @@
|
||||||
"private": true,
|
"private": true,
|
||||||
"exports": {
|
"exports": {
|
||||||
"./server": "./src/server/index.ts",
|
"./server": "./src/server/index.ts",
|
||||||
"./client": "./src/client/index.ts",
|
"./client": "./src/client.ts",
|
||||||
"./next/middleware": "./src/next/middleware.ts"
|
"./next/middleware": "./src/next/middleware.ts"
|
||||||
},
|
},
|
||||||
"scripts": {
|
"scripts": {
|
||||||
|
|
|
@ -1,10 +1,10 @@
|
||||||
"use client";
|
"use client";
|
||||||
import Cookies from "js-cookie";
|
import Cookies from "js-cookie";
|
||||||
import posthog from "posthog-js";
|
import posthog from "posthog-js";
|
||||||
import { PostHogProvider as Provider } from "posthog-js/react";
|
|
||||||
import React from "react";
|
|
||||||
|
|
||||||
import { POSTHOG_BOOTSTAP_DATA_COOKIE_NAME } from "../constants";
|
import { POSTHOG_BOOTSTAP_DATA_COOKIE_NAME } from "./constants";
|
||||||
|
|
||||||
|
export { PostHogProvider, usePostHog } from "posthog-js/react";
|
||||||
|
|
||||||
if (typeof window !== "undefined" && process.env.NEXT_PUBLIC_POSTHOG_API_KEY) {
|
if (typeof window !== "undefined" && process.env.NEXT_PUBLIC_POSTHOG_API_KEY) {
|
||||||
let bootstrapData = {};
|
let bootstrapData = {};
|
||||||
|
@ -31,6 +31,4 @@ if (typeof window !== "undefined" && process.env.NEXT_PUBLIC_POSTHOG_API_KEY) {
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
export function PostHogProvider(props: { children?: React.ReactNode }) {
|
export { posthog };
|
||||||
return <Provider client={posthog}>{props.children}</Provider>;
|
|
||||||
}
|
|
|
@ -1,4 +0,0 @@
|
||||||
"use client";
|
|
||||||
|
|
||||||
export { PostHogProvider } from "./provider";
|
|
||||||
export { usePostHog } from "posthog-js/react";
|
|
Loading…
Add table
Add a link
Reference in a new issue