diff --git a/site/components/common/Footer/Footer.tsx b/site/components/common/Footer/Footer.tsx index b2447f0cd..313c9154a 100644 --- a/site/components/common/Footer/Footer.tsx +++ b/site/components/common/Footer/Footer.tsx @@ -1,22 +1,15 @@ import { FC } from 'react' import cn from 'clsx' import Link from 'next/link' -import dynamic from 'next/dynamic' import { useRouter } from 'next/router' import type { Page } from '@commerce/types/page' import getSlug from '@lib/get-slug' import { Github, Vercel } from '@components/icons' import { Logo, Container } from '@components/ui' import { I18nWidget } from '@components/common' +import ThemeSwitcher from '@components/ui/ThemeSwitcher' import s from './Footer.module.css' -const ThemeSwitcher = dynamic(() => import('@components/ui/ThemeSwitcher'), { - ssr: false, - loading: () => ( -
- ), -}) - interface Props { className?: string children?: any diff --git a/site/components/common/I18nWidget/I18nWidget.module.css b/site/components/common/I18nWidget/I18nWidget.module.css index 5b486d537..c07364250 100644 --- a/site/components/common/I18nWidget/I18nWidget.module.css +++ b/site/components/common/I18nWidget/I18nWidget.module.css @@ -32,7 +32,7 @@ } .icon.active { - transform: rotate(180deg); + transform: rotate(90deg); } @screen lg { diff --git a/site/components/common/I18nWidget/I18nWidget.tsx b/site/components/common/I18nWidget/I18nWidget.tsx index 7c9124e3e..9bbb626d5 100644 --- a/site/components/common/I18nWidget/I18nWidget.tsx +++ b/site/components/common/I18nWidget/I18nWidget.tsx @@ -3,7 +3,7 @@ import Link from 'next/link' import { FC, useState } from 'react' import { useRouter } from 'next/router' import s from './I18nWidget.module.css' -import { Cross, ChevronUp } from '@components/icons' +import { Cross, ChevronRight } from '@components/icons' import ClickOutside from '@lib/click-outside' import Image from 'next/image' interface LOCALE_DATA { @@ -61,7 +61,7 @@ const I18nWidget: FC = () => { /> {options && ( - + )} diff --git a/site/components/ui/ThemeSwitcher/ThemeSwitcher.tsx b/site/components/ui/ThemeSwitcher/ThemeSwitcher.tsx index 55671afc9..c754d1242 100644 --- a/site/components/ui/ThemeSwitcher/ThemeSwitcher.tsx +++ b/site/components/ui/ThemeSwitcher/ThemeSwitcher.tsx @@ -1,18 +1,23 @@ -import { useState } from 'react' +import { useEffect, useState } from 'react' import { useTheme } from 'next-themes' -import { ChevronUp, Cross } from '@components/icons' +import { ChevronRight, Cross } from '@components/icons' import cn from 'clsx' import ClickOutside from '@lib/click-outside' import ThemeIcon from './ThemeIcon' const ThemeSwitcher = () => { + const [mounted, setMounted] = useState(false) const [display, setDisplay] = useState(false) const { theme, themes, setTheme } = useTheme() + useEffect(() => setMounted(true), []) + + if (!mounted) return null + return ( setDisplay(false)}> - +
) }