Shared:Components:PortalLogo: fix for SSR

This commit is contained in:
Timofey Boyko 2024-06-28 18:44:52 +03:00
parent 5f712f87f3
commit a966d2e948

View File

@ -38,7 +38,9 @@ import type { PortalLogoProps } from "./PortalLogo.types";
const PortalLogo = ({ className, isResizable = false }: PortalLogoProps) => { const PortalLogo = ({ className, isResizable = false }: PortalLogoProps) => {
const theme = useTheme(); const theme = useTheme();
const [size, setSize] = useState(window.innerWidth); const [size, setSize] = useState(
typeof window !== "undefined" ? window.innerWidth : 0,
);
const onResize = () => { const onResize = () => {
setSize(window.innerWidth); setSize(window.innerWidth);