@@ -320,6 +320,7 @@ export async function getServerSideProps(context: GetServerSidePropsContext) {
plan: true,
theme: true,
brandColor: true,
+ darkBrandColor: true,
},
},
team: {
@@ -348,6 +349,7 @@ export async function getServerSideProps(context: GetServerSidePropsContext) {
plan: true,
theme: true,
brandColor: true,
+ darkBrandColor: true,
},
});
if (user) {
@@ -365,6 +367,7 @@ export async function getServerSideProps(context: GetServerSidePropsContext) {
name: eventType.team?.name || eventType.users[0]?.name || null,
theme: (!eventType.team?.name && eventType.users[0]?.theme) || null,
brandColor: eventType.team ? null : eventType.users[0].brandColor,
+ darkBrandColor: eventType.team ? null : eventType.users[0].darkBrandColor,
};
return {
diff --git a/apps/web/pages/team/[slug]/[type].tsx b/apps/web/pages/team/[slug]/[type].tsx
index b1abadf8..d50c124d 100644
--- a/apps/web/pages/team/[slug]/[type].tsx
+++ b/apps/web/pages/team/[slug]/[type].tsx
@@ -48,6 +48,7 @@ export const getServerSideProps = async (context: GetServerSidePropsContext) =>
hideBranding: true,
plan: true,
brandColor: true,
+ darkBrandColor: true,
},
},
title: true,
@@ -105,6 +106,7 @@ export const getServerSideProps = async (context: GetServerSidePropsContext) =>
theme: null,
weekStart: "Sunday",
brandColor: "" /* TODO: Add a way to set a brand color for Teams */,
+ darkBrandColor: "" /* TODO: Add a way to set a brand color for Teams */,
},
date: dateParam,
eventType: eventTypeObject,
diff --git a/apps/web/pages/team/[slug]/book.tsx b/apps/web/pages/team/[slug]/book.tsx
index 1772952e..bb161076 100644
--- a/apps/web/pages/team/[slug]/book.tsx
+++ b/apps/web/pages/team/[slug]/book.tsx
@@ -102,6 +102,7 @@ export async function getServerSideProps(context: GetServerSidePropsContext) {
image: eventTypeObject.team?.logo || null,
theme: null /* Teams don't have a theme, and `BookingPage` uses it */,
brandColor: null /* Teams don't have a brandColor, and `BookingPage` uses it */,
+ darkBrandColor: null /* Teams don't have a darkBrandColor, and `BookingPage` uses it */,
},
eventType: eventTypeObject,
booking,
diff --git a/apps/web/public/static/locales/en/common.json b/apps/web/public/static/locales/en/common.json
index 67fa3055..6814e243 100644
--- a/apps/web/public/static/locales/en/common.json
+++ b/apps/web/public/static/locales/en/common.json
@@ -513,6 +513,8 @@
"first_day_of_week": "First Day of Week",
"single_theme": "Single Theme",
"brand_color": "Brand Color",
+ "light_brand_color": "Brand Color (Light Theme)",
+ "dark_brand_color": "Brand Color (Dark Theme)",
"file_not_named": "File is not named [idOrSlug]/[user]",
"create_team": "Create Team",
"name": "Name",
diff --git a/apps/web/server/createContext.ts b/apps/web/server/createContext.ts
index b3cabdfb..358213f3 100644
--- a/apps/web/server/createContext.ts
+++ b/apps/web/server/createContext.ts
@@ -45,6 +45,7 @@ async function getUserFromSession({
twoFactorEnabled: true,
identityProvider: true,
brandColor: true,
+ darkBrandColor: true,
plan: true,
away: true,
credentials: {
diff --git a/apps/web/server/routers/viewer.tsx b/apps/web/server/routers/viewer.tsx
index 984870e1..85bc9ee3 100644
--- a/apps/web/server/routers/viewer.tsx
+++ b/apps/web/server/routers/viewer.tsx
@@ -83,6 +83,7 @@ const loggedInViewerRouter = createProtectedRouter()
twoFactorEnabled: user.twoFactorEnabled,
identityProvider: user.identityProvider,
brandColor: user.brandColor,
+ darkBrandColor: user.darkBrandColor,
plan: user.plan,
away: user.away,
};
@@ -616,6 +617,7 @@ const loggedInViewerRouter = createProtectedRouter()
weekStart: z.string().optional(),
hideBranding: z.boolean().optional(),
brandColor: z.string().optional(),
+ darkBrandColor: z.string().optional(),
theme: z.string().optional().nullable(),
completedOnboarding: z.boolean().optional(),
locale: z.string().optional(),
diff --git a/apps/web/styles/globals.css b/apps/web/styles/globals.css
index 3adf00d5..e6119949 100644
--- a/apps/web/styles/globals.css
+++ b/apps/web/styles/globals.css
@@ -5,6 +5,8 @@
:root {
--brand-color: #292929;
--brand-text-color: #ffffff;
+ --brand-color-dark-mode: #fafafa;
+ --brand-text-color-dark-mode: #292929;
}
/* PhoneInput dark-mode overrides (it would add a lot of boilerplate to do this in JavaScript) */
diff --git a/apps/web/tailwind.config.js b/apps/web/tailwind.config.js
index 18de10e5..b6880872 100644
--- a/apps/web/tailwind.config.js
+++ b/apps/web/tailwind.config.js
@@ -14,6 +14,8 @@ module.exports = {
/* your primary brand color */
brand: "var(--brand-color)",
brandcontrast: "var(--brand-text-color)",
+ darkmodebrand: "var(--brand-color-dark-mode)",
+ darkmodebrandcontrast: "var(--brand-text-color-dark-mode)",
black: "#111111",
gray: {
50: "#F8F8F8",
diff --git a/packages/prisma/migrations/20220302110201_add_dark_mode_brand_color/migration.sql b/packages/prisma/migrations/20220302110201_add_dark_mode_brand_color/migration.sql
new file mode 100644
index 00000000..e1d0adf9
--- /dev/null
+++ b/packages/prisma/migrations/20220302110201_add_dark_mode_brand_color/migration.sql
@@ -0,0 +1,2 @@
+-- AlterTable
+ALTER TABLE "users" ADD COLUMN "darkBrandColor" TEXT NOT NULL DEFAULT E'#fafafa';
\ No newline at end of file
diff --git a/packages/prisma/schema.prisma b/packages/prisma/schema.prisma
index 073170ba..98726bbd 100644
--- a/packages/prisma/schema.prisma
+++ b/packages/prisma/schema.prisma
@@ -142,6 +142,7 @@ model User {
Schedule Schedule[]
webhooks Webhook[]
brandColor String @default("#292929")
+ darkBrandColor String @default("#fafafa")
// the location where the events will end up
destinationCalendar DestinationCalendar?
away Boolean @default(false)
diff --git a/packages/ui/Button.tsx b/packages/ui/Button.tsx
index 2e996afc..6b63432d 100644
--- a/packages/ui/Button.tsx
+++ b/packages/ui/Button.tsx
@@ -65,7 +65,7 @@ export const Button = forwardRef