From 370ebdee247800d4d8a1fd7918e0e076b0a6874f Mon Sep 17 00:00:00 2001 From: sabaimran Date: Wed, 7 Aug 2024 18:49:06 +0530 Subject: [PATCH] Standardized the mobile width calculation --- src/interface/web/app/agents/page.tsx | 4 ++-- src/interface/web/app/automations/page.tsx | 4 ++-- .../web/app/components/chatHistory/chatHistory.tsx | 4 ++-- src/interface/web/app/components/navMenu/navMenu.tsx | 4 ++-- src/interface/web/app/factchecker/page.tsx | 8 ++++---- 5 files changed, 12 insertions(+), 12 deletions(-) diff --git a/src/interface/web/app/agents/page.tsx b/src/interface/web/app/agents/page.tsx index c9e8a1bd..b201504e 100644 --- a/src/interface/web/app/agents/page.tsx +++ b/src/interface/web/app/agents/page.tsx @@ -270,11 +270,11 @@ export default function Agents() { useEffect(() => { if (typeof window !== "undefined") { - setIsMobileWidth(window.innerWidth < 768); + setIsMobileWidth(window.innerWidth < 786); } window.addEventListener("resize", () => { - setIsMobileWidth(window.innerWidth < 768); + setIsMobileWidth(window.innerWidth < 786); }); }, []); diff --git a/src/interface/web/app/automations/page.tsx b/src/interface/web/app/automations/page.tsx index 7db98e77..3f402769 100644 --- a/src/interface/web/app/automations/page.tsx +++ b/src/interface/web/app/automations/page.tsx @@ -985,12 +985,12 @@ export default function Automations() { const ipLocationData = useIPLocationData(); useEffect(() => { - if (window.innerWidth < 768) { + if (window.innerWidth < 786) { setIsMobileWidth(true); } window.addEventListener("resize", () => { - setIsMobileWidth(window.innerWidth < 768); + setIsMobileWidth(window.innerWidth < 786); }); }, []); diff --git a/src/interface/web/app/components/chatHistory/chatHistory.tsx b/src/interface/web/app/components/chatHistory/chatHistory.tsx index 663ae3eb..5afe2293 100644 --- a/src/interface/web/app/components/chatHistory/chatHistory.tsx +++ b/src/interface/web/app/components/chatHistory/chatHistory.tsx @@ -79,10 +79,10 @@ export default function ChatHistory(props: ChatHistoryProps) { useEffect(() => { window.addEventListener("resize", () => { - setIsMobileWidth(window.innerWidth < 768); + setIsMobileWidth(window.innerWidth < 786); }); - setIsMobileWidth(window.innerWidth < 768); + setIsMobileWidth(window.innerWidth < 786); }, []); useEffect(() => { diff --git a/src/interface/web/app/components/navMenu/navMenu.tsx b/src/interface/web/app/components/navMenu/navMenu.tsx index e59d686a..6ab9be82 100644 --- a/src/interface/web/app/components/navMenu/navMenu.tsx +++ b/src/interface/web/app/components/navMenu/navMenu.tsx @@ -43,10 +43,10 @@ export default function NavMenu() { const [initialLoadDone, setInitialLoadDone] = useState(false); useEffect(() => { - setIsMobileWidth(window.innerWidth < 768); + setIsMobileWidth(window.innerWidth < 786); window.addEventListener("resize", () => { - setIsMobileWidth(window.innerWidth < 768); + setIsMobileWidth(window.innerWidth < 786); }); if (localStorage.getItem("theme") === "dark") { diff --git a/src/interface/web/app/factchecker/page.tsx b/src/interface/web/app/factchecker/page.tsx index 0aa6f9d5..4484aedf 100644 --- a/src/interface/web/app/factchecker/page.tsx +++ b/src/interface/web/app/factchecker/page.tsx @@ -152,10 +152,10 @@ function ReferenceVerification(props: ReferenceVerificationProps) { ); } - setIsMobileWidth(window.innerWidth < 768); + setIsMobileWidth(window.innerWidth < 786); window.addEventListener("resize", () => { - setIsMobileWidth(window.innerWidth < 768); + setIsMobileWidth(window.innerWidth < 786); }); }, [verificationStatement, props.conversationId, props.prefilledResponse]); @@ -283,10 +283,10 @@ export default function FactChecker() { } useEffect(() => { - setIsMobileWidth(window.innerWidth < 768); + setIsMobileWidth(window.innerWidth < 786); window.addEventListener("resize", () => { - setIsMobileWidth(window.innerWidth < 768); + setIsMobileWidth(window.innerWidth < 786); }); }, []);