-
-
-
-
JUNOHUB
+
+ {isOpen && (
+ <>
+ setIsOpen(false)}
+ />
+
+ {/* Header with close button */}
+
+
+
+
-
+
JUNOHUB
- {/* Sidebar Content */}
-
-
-
-
- >
- )}
- ,
- document.body
- )}
+
+
+ {/* Sidebar Content */}
+
+
+
+
+ >
+ )}
+
>
)
}
diff --git a/src/components/Sidebar.tsx b/src/components/Sidebar.tsx
index 1e6e54c..0529b2d 100644
--- a/src/components/Sidebar.tsx
+++ b/src/components/Sidebar.tsx
@@ -19,6 +19,7 @@ import {
} from "lucide-react"
import { cn } from "@/lib/utils"
import { useTheme } from "@/components/ThemeProvider"
+import Image from "next/image"
const routes = [
{
@@ -101,10 +102,16 @@ export function Sidebar({ showLogo = true, className }: SidebarProps) {
{showLogo && (
diff --git a/src/components/landing/LandingFooter.tsx b/src/components/landing/LandingFooter.tsx
index 8fd192a..af59f6f 100644
--- a/src/components/landing/LandingFooter.tsx
+++ b/src/components/landing/LandingFooter.tsx
@@ -2,7 +2,8 @@
import Link from "next/link"
import { motion } from "framer-motion"
-import { Twitter, Github, Linkedin, Mail, Zap } from "lucide-react"
+import { Twitter, Github, Linkedin, Mail } from "lucide-react"
+import Image from "next/image"
export function LandingFooter() {
return (
@@ -13,9 +14,15 @@ export function LandingFooter() {
-
-
-
+
+
+
JUNOHUB
diff --git a/src/components/landing/LandingNavbar.tsx b/src/components/landing/LandingNavbar.tsx
index 6dbf343..63085c0 100644
--- a/src/components/landing/LandingNavbar.tsx
+++ b/src/components/landing/LandingNavbar.tsx
@@ -3,8 +3,9 @@
import { useState, useEffect } from "react"
import Link from "next/link"
import { motion, AnimatePresence } from "framer-motion"
-import { Menu, X, ArrowRight, Zap } from "lucide-react"
+import { Menu, X, ArrowRight } from "lucide-react"
import { cn } from "@/lib/utils"
+import Image from "next/image"
interface LandingNavbarProps {
isLoggedIn: boolean
@@ -44,9 +45,15 @@ export function LandingNavbar({ isLoggedIn }: LandingNavbarProps) {
)}
>
{/* Logo */}
-
-
-
+
+
+
JUNOHUB
diff --git a/src/hooks/useChatCrypto.ts b/src/hooks/useChatCrypto.ts
index a93299c..36b2048 100644
--- a/src/hooks/useChatCrypto.ts
+++ b/src/hooks/useChatCrypto.ts
@@ -6,27 +6,38 @@ import { ChatCrypto } from "@/lib/chat-crypto"
export const PRIVATE_KEY_STORAGE_KEY = "juno_chat_private_key"
export const PUBLIC_KEY_STORAGE_KEY = "juno_chat_public_key"
-export function useChatCrypto() {
+export function useChatCrypto(userId?: string) {
const [privateKey, setPrivateKey] = useState
(null)
const [hasKeys, setHasKeys] = useState(false)
const [loading, setLoading] = useState(true)
+ const privateKeyKey = userId ? `${PRIVATE_KEY_STORAGE_KEY}_${userId}` : PRIVATE_KEY_STORAGE_KEY
+ const publicKeyKey = userId ? `${PUBLIC_KEY_STORAGE_KEY}_${userId}` : PUBLIC_KEY_STORAGE_KEY
+
useEffect(() => {
- const stored = localStorage.getItem(PRIVATE_KEY_STORAGE_KEY)
+ if (!userId) {
+ setLoading(false)
+ return
+ }
+ const stored = localStorage.getItem(privateKeyKey)
if (stored) {
setPrivateKey(stored)
setHasKeys(true)
+ } else {
+ setPrivateKey(null)
+ setHasKeys(false)
}
setLoading(false)
- }, [])
+ }, [userId, privateKeyKey])
const setupKeys = useCallback(async () => {
+ if (!userId) throw new Error("User ID required for chat setup")
setLoading(true)
try {
const keys = await ChatCrypto.generateKeyPair()
- localStorage.setItem(PRIVATE_KEY_STORAGE_KEY, keys.privateKey)
- localStorage.setItem(PUBLIC_KEY_STORAGE_KEY, keys.publicKey)
+ localStorage.setItem(privateKeyKey, keys.privateKey)
+ localStorage.setItem(publicKeyKey, keys.publicKey)
setPrivateKey(keys.privateKey)
setHasKeys(true)
@@ -45,12 +56,12 @@ export function useChatCrypto() {
} finally {
setLoading(false)
}
- }, [])
+ }, [userId, privateKeyKey, publicKeyKey])
const getStoredPublicKey = useCallback((): string | null => {
- if (typeof window === "undefined") return null
- return localStorage.getItem(PUBLIC_KEY_STORAGE_KEY)
- }, [])
+ if (typeof window === "undefined" || !userId) return null
+ return localStorage.getItem(publicKeyKey)
+ }, [userId, publicKeyKey])
return {
privateKey,