booking page: only scroll to bottom on mobile (#6453)
* move useMediaQuery into packages * revert logo.tsx
This commit is contained in:
1 parent
690edcf0a7
commit
8fc0dfb763
3 files changed
+31
-6
No files matched your search
@@ -5,6 +5,7 @@ import { useEmbedStyles } from "@calcom/embed-core/embed-iframe";
|
||||
import classNames from "@calcom/lib/classNames";
|
||||
import { daysInMonth, yyyymmdd } from "@calcom/lib/date-fns";
|
||||
import { useLocale } from "@calcom/lib/hooks/useLocale";
|
||||
import useMediaQuery from "@calcom/lib/hooks/useMediaQuery";
|
||||
import { weekdayNames } from "@calcom/lib/weekday";
|
||||
import { Button, Icon, SkeletonText } from "@calcom/ui";
|
||||
|
||||
@@ -135,6 +136,9 @@ const Days = ({
|
||||
const date = browsingDate.set("date", day);
|
||||
days.push(date);
|
||||
}
|
||||
|
||||
const isMobile = useMediaQuery("(max-width: 768px)");
|
||||
|
||||
return (
|
||||
<>
|
||||
{days.map((day, idx) => (
|
||||
@@ -153,12 +157,13 @@ const Days = ({
|
||||
date={day}
|
||||
onClick={() => {
|
||||
props.onChange(day);
|
||||
setTimeout(() => {
|
||||
window.scrollTo({
|
||||
top: 360,
|
||||
behavior: "smooth",
|
||||
});
|
||||
}, 500);
|
||||
isMobile &&
|
||||
setTimeout(() => {
|
||||
window.scrollTo({
|
||||
top: 360,
|
||||
behavior: "smooth",
|
||||
});
|
||||
}, 500);
|
||||
}}
|
||||
disabled={
|
||||
(includedDates && !includedDates.includes(yyyymmdd(day))) ||
|
||||
|
||||
Reference in new issue
Block a user