Merge version_2 into main #8
@@ -1,6 +1,6 @@
|
||||
"use client";
|
||||
|
||||
import { useEffect, useState } from "react";
|
||||
import { useState } from "react";
|
||||
import { ThemeProvider } from "@/providers/themeProvider/ThemeProvider";
|
||||
import NavbarLayoutFloatingInline from "@/components/navbar/NavbarLayoutFloatingInline";
|
||||
import HeroBillboardGallery from "@/components/sections/hero/HeroBillboardGallery";
|
||||
@@ -30,37 +30,7 @@ import {
|
||||
export default function LandingPage() {
|
||||
const [isAuthenticated, setIsAuthenticated] = useState(false);
|
||||
const [showOnboarding, setShowOnboarding] = useState(false);
|
||||
const [mounted, setMounted] = useState(false);
|
||||
|
||||
// Initialize authentication state from localStorage
|
||||
useEffect(() => {
|
||||
const checkAuth = () => {
|
||||
try {
|
||||
const authToken = localStorage.getItem("authToken");
|
||||
const hasCompletedOnboarding = localStorage.getItem(
|
||||
"hasCompletedOnboarding"
|
||||
);
|
||||
|
||||
if (authToken) {
|
||||
setIsAuthenticated(true);
|
||||
if (!hasCompletedOnboarding) {
|
||||
setShowOnboarding(true);
|
||||
}
|
||||
} else {
|
||||
setIsAuthenticated(false);
|
||||
setShowOnboarding(false);
|
||||
}
|
||||
} catch (error) {
|
||||
console.error("Error checking authentication:", error);
|
||||
}
|
||||
};
|
||||
|
||||
checkAuth();
|
||||
}, []);
|
||||
|
||||
useEffect(() => {
|
||||
setMounted(true);
|
||||
}, []);
|
||||
const [mounted, setMounted] = useState(true);
|
||||
|
||||
const handleCompleteOnboarding = () => {
|
||||
try {
|
||||
@@ -87,7 +57,6 @@ export default function LandingPage() {
|
||||
return null;
|
||||
}
|
||||
|
||||
// If user is authenticated but hasn't completed onboarding, show onboarding flow
|
||||
if (isAuthenticated && showOnboarding) {
|
||||
return (
|
||||
<ThemeProvider
|
||||
@@ -148,7 +117,6 @@ export default function LandingPage() {
|
||||
);
|
||||
}
|
||||
|
||||
// Main landing page or authenticated dashboard
|
||||
return (
|
||||
<ThemeProvider
|
||||
defaultButtonVariant="hover-bubble"
|
||||
|
||||
Reference in New Issue
Block a user