File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 11"use client" ;
22
3- import { useEffect , useState } from "react" ;
4- import { User } from "firebase/auth" ; // Adjust the import path based on your Firebase setup
53import { useRouter } from "next/navigation" ;
64import { Plus } from "lucide-react" ;
7- import { onAuthStateChanged } from "@/lib/firebase/auth" ;
85
96const AddProjectFAB = ( ) => {
107 const router = useRouter ( ) ;
11- const [ user , setUser ] = useState < User | null > ( null ) ;
12-
13- useEffect ( ( ) => {
14- const unsubscribe = onAuthStateChanged ( ( currentUser ) => {
15- setUser ( currentUser ) ;
16- } ) ;
17- return ( ) => unsubscribe ( ) ;
18- } , [ ] ) ;
198
209 const handleClick = ( ) => {
21- if ( user ) {
22- router . push ( "/add-project" ) ;
23- } else {
24- router . push ( "/login" ) ; // Redirect to login if not authenticated
25- }
10+ router . push ( "/add-project" ) ; // 🚀 No authentication check
2611 } ;
2712
2813 return (
You can’t perform that action at this time.
0 commit comments