Skip to content

Commit c1208b8

Browse files
committed
fix flash of desktop screen in mobile version
1 parent e92f9d6 commit c1208b8

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

src/components/ContactUs/ContactUs.tsx

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import DesktopVersion from './DesktopVersion';
33
import MobileVersion from './MobileVersion';
44

55
export default function ContactUs() {
6-
const [screenWidth, setScreenWidth] = useState(1024);
6+
const [screenWidth, setScreenWidth] = useState<number | null>(null);
77

88
const breakpoint = 1024;
99

@@ -17,6 +17,8 @@ export default function ContactUs() {
1717
return () => window.removeEventListener('resize', handleResize);
1818
}, []);
1919

20+
if (!screenWidth) return null;
21+
2022
return (
2123
<section id="contact-us">
2224
<h2 className="font-montserrat text-base uppercase w-fit mx-auto py-5">

0 commit comments

Comments
 (0)