Skip to content

Commit

Permalink
feat: auth + stripe, fix: pipe store subcommand
Browse files Browse the repository at this point in the history
  • Loading branch information
louis030195 committed Nov 30, 2024
1 parent e90d426 commit 22105fe
Show file tree
Hide file tree
Showing 15 changed files with 1,045 additions and 335 deletions.
6 changes: 0 additions & 6 deletions .cargo/config.toml
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,4 @@ rustflags = [
[target.x86_64-unknown-linux-gnu]
rustflags = ["-C", "link-arg=-Wl,--allow-multiple-definition"]

[target.aarch64-apple-darwin]
rustflags = ["-L", "screenpipe-vision/lib"]

[target.x86_64-apple-darwin]
rustflags = ["-L", "screenpipe-vision/lib"]


2 changes: 1 addition & 1 deletion examples/typescript/pipe-for-loom/components/header.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ export default function Header() {
src="/128x128.png"
alt="screenpipe-logo"
/>
<h1 className="font-bold text-center text-2xl">Screenpipe</h1>
<h1 className="font-bold text-center text-2xl">screenpipe</h1>
</div>
);
}
26 changes: 18 additions & 8 deletions screenpipe-app-tauri/app/layout.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import { Inter } from "next/font/google";
import "./globals.css";
import { Providers } from "./providers";
import { Toaster } from "@/components/ui/toaster";
import { ClerkProvider } from "@clerk/nextjs";

const inter = Inter({ subsets: ["latin"] });

Expand All @@ -18,14 +19,23 @@ export default function RootLayout({
}>) {
return (
<html lang="en">
<Providers>
{/* https://posthog.com/docs/libraries/next-js for more info */}
<body className={inter.className}>
{children}

<Toaster />
</body>
</Providers>
<ClerkProvider
publishableKey="pk_live_Y2xlcmsudGF1cmkubG9jYWxob3N0JA"
appearance={{
baseTheme: undefined,
layout: {
socialButtonsPlacement: "bottom",
socialButtonsVariant: "blockButton",
},
}}
>
<Providers>
<body className={inter.className}>
{children}
<Toaster />
</body>
</Providers>
</ClerkProvider>
</html>
);
}
38 changes: 38 additions & 0 deletions screenpipe-app-tauri/components/auth.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
import { SignInButton, SignOutButton, useUser } from "@clerk/nextjs";
import { Button } from "./ui/button";
import { useEffect } from "react";
import posthog from "posthog-js";
import { useSettings } from "@/lib/hooks/use-settings";
export function AuthButton() {
const { isSignedIn, user } = useUser();
const { settings } = useSettings();

useEffect(() => {
posthog.identify(settings.userId, {
email: user?.primaryEmailAddress?.emailAddress,
clerkId: user?.id,
});
posthog.setPersonProperties({
email: user?.primaryEmailAddress?.emailAddress,
clerkId: user?.id,
});
}, [isSignedIn, user, settings.userId]);

return (
<div >
{isSignedIn ? (
<SignOutButton>
<Button variant="outline">
sign out
</Button>
</SignOutButton>
) : (
<SignInButton mode="redirect">
<Button variant="outline">
sign in
</Button>
</SignInButton>
)}
</div>
);
}
4 changes: 0 additions & 4 deletions screenpipe-app-tauri/components/meeting-history.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -146,10 +146,6 @@ export default function MeetingHistory() {
useEffect(() => {
if (posthog) {
posthog.identify(settings.userId);
posthog.people.set({
userId: settings.userId,
// Add any other relevant user properties
});
}
}, [posthog, settings.userId]);

Expand Down
Loading

0 comments on commit 22105fe

Please sign in to comment.