feat: initialize Prisma schema and scaffold core application modules including auth, blogs, events, and business directories
Some checks failed
Build and Push App / build (push) Failing after 47s

This commit is contained in:
2026-04-22 22:59:12 +02:00
parent b01b2f6476
commit 2e7cb65a29
32 changed files with 1392 additions and 310 deletions

View File

@@ -6,6 +6,7 @@ import { useRouter, usePathname } from 'next/navigation';
interface UserContextType {
user: User | null;
settings: any | null;
login: (user: User) => void;
logout: () => void;
}
@@ -14,6 +15,7 @@ const UserContext = createContext<UserContextType | undefined>(undefined);
export function UserProvider({ children }: { children: ReactNode }) {
const [user, setUser] = useState<User | null>(null);
const [settings, setSettings] = useState<any>(null);
const router = useRouter();
const pathname = usePathname();
@@ -22,6 +24,12 @@ export function UserProvider({ children }: { children: ReactNode }) {
if (savedUser) {
setUser(JSON.parse(savedUser));
}
// Fetch settings
fetch('/api/settings')
.then(res => res.json())
.then(data => setSettings(data))
.catch(err => console.error('Error fetching settings:', err));
}, []);
// Global suspension check
@@ -42,7 +50,7 @@ export function UserProvider({ children }: { children: ReactNode }) {
};
return (
<UserContext.Provider value={{ user, login, logout }}>
<UserContext.Provider value={{ user, settings, login, logout }}>
{children}
</UserContext.Provider>
);