Merge version_2 into main #4
@@ -9,20 +9,13 @@ import TestimonialCardThirteen from '@/components/sections/testimonial/Testimoni
|
||||
import ContactCTA from '@/components/sections/contact/ContactCTA';
|
||||
import FooterCard from '@/components/sections/footer/FooterCard';
|
||||
import { Heart, TrendingUp, Calendar, Flame, Star, Award, Zap, MessageSquare, Twitter, Instagram, MessageCircle } from 'lucide-react';
|
||||
import { useEffect, useState } from 'react';
|
||||
import { useEffect, useState, useCallback } from 'react';
|
||||
|
||||
export default function LandingPage() {
|
||||
const [isDark, setIsDark] = useState(false);
|
||||
const [mounted, setMounted] = useState(false);
|
||||
|
||||
useEffect(() => {
|
||||
setMounted(true);
|
||||
const theme = localStorage.getItem('theme') || 'light';
|
||||
setIsDark(theme === 'dark');
|
||||
applyTheme(theme);
|
||||
}, []);
|
||||
|
||||
const applyTheme = (theme: string) => {
|
||||
const applyTheme = useCallback((theme: string) => {
|
||||
const isDarkTheme = theme === 'dark';
|
||||
setIsDark(isDarkTheme);
|
||||
|
||||
@@ -53,7 +46,14 @@ export default function LandingPage() {
|
||||
}
|
||||
|
||||
localStorage.setItem('theme', theme);
|
||||
};
|
||||
}, []);
|
||||
|
||||
useEffect(() => {
|
||||
setMounted(true);
|
||||
const theme = localStorage.getItem('theme') || 'light';
|
||||
setIsDark(theme === 'dark');
|
||||
applyTheme(theme);
|
||||
}, [applyTheme]);
|
||||
|
||||
const toggleTheme = () => {
|
||||
const newTheme = isDark ? 'light' : 'dark';
|
||||
|
||||
Reference in New Issue
Block a user