feat(notifications): add navbar dropdown and sse client

This commit is contained in:
2026-04-25 11:29:53 +03:30
parent 441cc0c008
commit 2d903de97b
10 changed files with 1098 additions and 242 deletions

View File

@@ -4,9 +4,10 @@ import { Button } from "../components/ui/button"
import { Input } from "../components/ui/input"
import { SettingsMenu } from "../components/SettingsMenu"
import { ArrowLeft, ArrowRight, Command, Loader2, Eye, EyeOff } from "lucide-react"
import { toast } from "sonner"
import { useTranslation } from "../hooks/useTranslation"
import { loginWithPassword, sendOtp, loginWithOtp } from "../api/users"
import { toast } from "sonner"
import { useTranslation } from "../hooks/useTranslation"
import { loginWithPassword, sendOtp, loginWithOtp } from "../api/users"
import { setSessionTokens } from "../lib/session"
type AuthStep = "mobile" | "password" | "otp"
type AuthMode = "login" | "register"
@@ -24,12 +25,11 @@ export default function Auth() {
const [loading, setLoading] = useState(false)
const [showPassword, setShowPassword] = useState(false) // Added state for password visibility
const handleTokenResponse = (access: string, refresh: string) => {
localStorage.setItem("accessToken", access)
localStorage.setItem("refreshToken", refresh)
toast.success(t.login.toasts.successLogin)
navigate("/profile")
}
const handleTokenResponse = (access: string, refresh: string) => {
setSessionTokens(access, refresh)
toast.success(t.login.toasts.successLogin)
navigate("/profile")
}
const handleSendOtp = async (selectedMode: AuthMode) => {
if (!mobile) return toast.error(t.login.toasts.enterMobile)