Standardized the mobile width calculation

This commit is contained in:
sabaimran 2024-08-07 18:49:06 +05:30
parent 52fed6023f
commit 370ebdee24
5 changed files with 12 additions and 12 deletions

View file

@ -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);
});
}, []);

View file

@ -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);
});
}, []);

View file

@ -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(() => {

View file

@ -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") {

View file

@ -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);
});
}, []);