diff --git a/src/app/(routes)/(website)/components/footer/footer.tsx b/src/app/(routes)/(website)/components/footer/footer.tsx
index 3d1343e..b736973 100644
--- a/src/app/(routes)/(website)/components/footer/footer.tsx
+++ b/src/app/(routes)/(website)/components/footer/footer.tsx
@@ -54,14 +54,14 @@ export default async function Footer() {
))}
diff --git a/src/app/(routes)/(website)/components/header/header.tsx b/src/app/(routes)/(website)/components/header/header.tsx
index 860754c..1eb0c91 100644
--- a/src/app/(routes)/(website)/components/header/header.tsx
+++ b/src/app/(routes)/(website)/components/header/header.tsx
@@ -12,15 +12,17 @@ export default function Header() {
const [dict, setDict] = useState(null);
const [scrolled, setScrolled] = useState(false);
+ const selectedLocale = getCookie("selectedLocale") || getCookie("defaultLocale") || "en";
+
useEffect(() => {
const loadDict = async () => {
- const selectedLocale = getCookie("selectedLocale");
- const defaultLocale = getCookie("defaultLocale");
- const d = await getDictionary((selectedLocale || defaultLocale || "en") as any);
+ const d = await getDictionary(selectedLocale as "en" | "fa");
setDict(d);
};
loadDict();
+ }, [selectedLocale]);
+ useEffect(() => {
const handleScroll = () => setScrolled(window.scrollY > 50);
window.addEventListener("scroll", handleScroll, { passive: true });
handleScroll();
diff --git a/src/app/(routes)/(website)/components/hero/hero.tsx b/src/app/(routes)/(website)/components/hero/hero.tsx
index 69cbd3a..81034d1 100644
--- a/src/app/(routes)/(website)/components/hero/hero.tsx
+++ b/src/app/(routes)/(website)/components/hero/hero.tsx
@@ -57,14 +57,14 @@ export default function Hero({ dict }: HeroProps) {
viewport={{ once: true }}
whileHover={{ scale: 1.2, rotate: 5 }}
whileTap={{ scale: 0.9 }}
- className="p-2 rounded-full glass-panel hover:text-primary transition-colors group"
+ className="p-2 rounded-full glass-panel hover:text-primary transition-colors group dark-invert-img"
>
))}
diff --git a/src/app/(routes)/(website)/components/services/services.tsx b/src/app/(routes)/(website)/components/services/services.tsx
index 63536cb..30d4038 100644
--- a/src/app/(routes)/(website)/components/services/services.tsx
+++ b/src/app/(routes)/(website)/components/services/services.tsx
@@ -56,7 +56,7 @@ export default function Services({ dict }: ServicesProps) {
)}
diff --git a/src/app/(routes)/(website)/components/testimonials/testimonials.tsx b/src/app/(routes)/(website)/components/testimonials/testimonials.tsx
index b5f87a5..6fce376 100644
--- a/src/app/(routes)/(website)/components/testimonials/testimonials.tsx
+++ b/src/app/(routes)/(website)/components/testimonials/testimonials.tsx
@@ -32,14 +32,8 @@ interface TestimonialsProps {
export default function Testimonials({ dict }: TestimonialsProps) {
const [currentIndex, setCurrentIndex] = useState(0);
const scrollRef = useRef(null);
- const [locale, setLocale] = useState("en");
-
- useEffect(() => {
- const sl = getCookie("selectedLocale");
- const dl = getCookie("defaultLocale");
- setLocale(sl || dl || "en");
- }, []);
+ const locale = getCookie("selectedLocale") || getCookie("defaultLocale") || "en";
const isRTL = locale === "fa";
const tData = dict.website.homePage.testimonials.data || [];
const maxIndex = Math.max(0, tData.length - 3);
@@ -137,16 +131,16 @@ export default function Testimonials({ dict }: TestimonialsProps) {
{tData.length > 3 && (
<>