Disable dark mode on the success page only for the organizer (#3001)

* disable darkmode only for organizer

* disable dark mode when user comes from user dashboard

* move Theme to shell

* fix build errors

* sort dates for recurring bookings

* new parameter if user comes from booking an event

Co-authored-by: CarinaWolli <[email protected]>
Co-authored-by: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com>
This commit is contained in:
authored and GitHub committed 2022-06-08 16:02:09 +02:00
1 parent 289cdefc27
commit abe5d53fc1
3 files changed
+24 -10

No files matched your search

+9 -2
View File
@@ -37,6 +37,7 @@ import classNames from "@lib/classNames";
import { WEBAPP_URL } from "@lib/config/constants";
import { shouldShowOnboarding } from "@lib/getting-started";
import useMeQuery from "@lib/hooks/useMeQuery";
import useTheme from "@lib/hooks/useTheme";
import { trpc } from "@lib/trpc";
import CustomBranding from "@components/CustomBranding";
@@ -249,7 +250,7 @@ const Layout = ({
</div>
<TrialBanner />
<div
className="rounded-sm pb-2 pl-3 pt-2 pr-2 hover:bg-gray-100 lg:mx-2 lg:pl-2"
className="rounded-sm pt-2 pb-2 pl-3 pr-2 hover:bg-gray-100 lg:mx-2 lg:pl-2"
data-testid="user-dropdown-trigger">
<span className="hidden lg:inline">
<UserDropdown />
@@ -416,6 +417,7 @@ type LayoutProps = {
export default function Shell(props: LayoutProps) {
const { loading, session } = useRedirectToLoginIfUnauthenticated(props.isPublic);
const { isRedirectingToOnboarding } = useRedirectToOnboardingIfNeeded();
const { isReady, Theme } = useTheme("light");
const query = useMeQuery();
const user = query.data;
@@ -424,7 +426,11 @@ export default function Shell(props: LayoutProps) {
const { status } = useSession();
const isLoading =
i18n.status === "loading" || query.status === "loading" || isRedirectingToOnboarding || loading;
i18n.status === "loading" ||
query.status === "loading" ||
isRedirectingToOnboarding ||
loading ||
!isReady;
if (isLoading) {
return (
@@ -438,6 +444,7 @@ export default function Shell(props: LayoutProps) {
return (
<>
<Theme />
<CustomBranding lightVal={user?.brandColor} darkVal={user?.darkBrandColor} />
<MemoizedLayout plan={user?.plan} status={status} {...props} isLoading={isLoading} />
</>
@@ -166,6 +166,7 @@ const BookingPage = ({
location,
eventName: profile.eventName || "",
bookingId: id,
isSuccessBookingPage: true,
},
});
},