-
Notifications
You must be signed in to change notification settings - Fork 6.8k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
CAL-1673: Use dark/light colors from user profile settings in booker (#…
…8905) * CAL-1673: Use dark/light colors from user profile settings in booker * Use system theme for dynamic booking, instead of theme set by first user.
- Loading branch information
1 parent
f20a5df
commit 175fc4f
Showing
3 changed files
with
33 additions
and
10 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
26 changes: 26 additions & 0 deletions
26
packages/features/bookings/Booker/utils/use-brand-colors.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
import { useEffect } from "react"; | ||
|
||
import useGetBrandingColours from "@calcom/lib/getBrandColours"; | ||
import useTheme from "@calcom/lib/hooks/useTheme"; | ||
import { useCalcomTheme } from "@calcom/ui"; | ||
|
||
export const useBrandColors = ({ | ||
brandColor, | ||
darkBrandColor, | ||
theme, | ||
}: { | ||
brandColor?: string; | ||
darkBrandColor?: string; | ||
theme?: string | null; | ||
}) => { | ||
const brandTheme = useGetBrandingColours({ | ||
lightVal: brandColor, | ||
darkVal: darkBrandColor, | ||
}); | ||
useCalcomTheme(brandTheme); | ||
const { setTheme } = useTheme(theme); | ||
|
||
useEffect(() => { | ||
if (theme) setTheme(theme); | ||
}, [setTheme, theme]); | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
175fc4f
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Successfully deployed to the following URLs:
ui – ./apps/storybook
cal-com-storybook.vercel.app
timelessui.com
www.timelessui.com
ui-git-main-cal.vercel.app
ui-cal.vercel.app
ui.cal.com