Feature/parallel booking availability (#3087)

This commit is contained in:
Omar López authored and GitHub committed 2022-06-19 16:02:00 +01:00
1 parent 7599f2384e
commit 2d28ca61a4
21 files changed
+242 -121

No files matched your search

+7 -1
View File
@@ -101,7 +101,13 @@ type TError = TRPCClientErrorLike<AppRouter>;
const withQuery = <TPath extends keyof TQueryValues & string>(
pathAndInput: [path: TPath, ...args: inferHandlerInput<TQueries[TPath]>],
params?: UseTRPCQueryOptions<TPath, TQueryValues[TPath]["input"], TQueryValues[TPath]["output"], TError>
params?: UseTRPCQueryOptions<
TPath,
TQueryValues[TPath]["input"],
TQueryValues[TPath]["output"],
TQueryValues[TPath]["output"],
TError
>
) => {
return function WithQuery(
opts: Omit<
+2 -2
View File
@@ -26,7 +26,7 @@ type AppPropsWithChildren = AppProps & {
};
const CustomI18nextProvider = (props: AppPropsWithChildren) => {
const { i18n, locale } = trpc.useQuery(["viewer.i18n"]).data ?? {
const { i18n, locale } = trpc.useQuery(["viewer.public.i18n"]).data ?? {
locale: "en",
};
@@ -42,7 +42,7 @@ const CustomI18nextProvider = (props: AppPropsWithChildren) => {
};
const AppProviders = (props: AppPropsWithChildren) => {
const session = trpc.useQuery(["viewer.session"]).data;
const session = trpc.useQuery(["viewer.public.session"]).data;
// No need to have intercom on public pages - Good for Page Performance
const isPublicPage = usePublicPage();
const RemainingProviders = (
+3
View File
@@ -1,5 +1,8 @@
import { EventType, PeriodType } from "@prisma/client";
import dayjs from "dayjs";
import dayjsBusinessTime from "dayjs-business-days2";
dayjs.extend(dayjsBusinessTime);
function isOutOfBounds(
time: dayjs.ConfigType,