add op.js to public site
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
'use client';
|
||||
|
||||
import { useState } from 'react';
|
||||
import { useEffect, useState } from 'react';
|
||||
import { Button } from '@/components/ui/button';
|
||||
import {
|
||||
Dialog,
|
||||
@@ -14,6 +14,14 @@ import {
|
||||
export function JoinWaitlist() {
|
||||
const [value, setValue] = useState('');
|
||||
const [open, setOpen] = useState(false);
|
||||
|
||||
useEffect(() => {
|
||||
if (open) {
|
||||
// @ts-ignore
|
||||
window.openpanel.event('waitlist_success');
|
||||
}
|
||||
}, [open]);
|
||||
|
||||
return (
|
||||
<>
|
||||
<Dialog open={open} onOpenChange={setOpen}>
|
||||
|
||||
@@ -3,6 +3,7 @@ import { cn } from '@/utils/cn';
|
||||
import '@/styles/globals.css';
|
||||
|
||||
import type { Metadata } from 'next';
|
||||
import Script from 'next/script';
|
||||
|
||||
import { defaultMeta } from './meta';
|
||||
|
||||
@@ -23,6 +24,13 @@ export default async function RootLayout({
|
||||
<body className={cn('min-h-screen font-sans antialiased grainy')}>
|
||||
{children}
|
||||
</body>
|
||||
<Script
|
||||
src="/op.js"
|
||||
data-url="https://api.openpanel.dev"
|
||||
data-client-id="301c6dc1-424c-4bc3-9886-a8beab09b615"
|
||||
data-track-screen-views="1"
|
||||
data-track-outgoing-links="1"
|
||||
/>
|
||||
</html>
|
||||
);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user