-
{t("only_owner_change")}
+ {isAdmin ? (
+
+ ) : (
+
+ {t("only_owner_change")}
+
)}
>
);
diff --git a/packages/features/settings/ThemeLabel.tsx b/packages/features/settings/ThemeLabel.tsx
new file mode 100644
index 0000000000..6329845869
--- /dev/null
+++ b/packages/features/settings/ThemeLabel.tsx
@@ -0,0 +1,35 @@
+interface ThemeLabelProps {
+ variant: "light" | "dark" | "system";
+ value?: "light" | "dark" | null;
+ label: string;
+ defaultChecked?: boolean;
+ register: any;
+}
+
+export default function ThemeLabel(props: ThemeLabelProps) {
+ const { variant, label, value, defaultChecked, register } = props;
+
+ return (
+
+ );
+}
diff --git a/packages/lib/server/queries/teams/index.ts b/packages/lib/server/queries/teams/index.ts
index 3774f1fa85..d0c708faac 100644
--- a/packages/lib/server/queries/teams/index.ts
+++ b/packages/lib/server/queries/teams/index.ts
@@ -33,6 +33,9 @@ export async function getTeamWithMembers(id?: number, slug?: string, userId?: nu
},
},
},
+ theme: true,
+ brandColor: true,
+ darkBrandColor: true,
eventTypes: {
where: {
hidden: false,
diff --git a/packages/prisma/migrations/20230131062229_add_theme_and_brand_colors_for_teams/migration.sql b/packages/prisma/migrations/20230131062229_add_theme_and_brand_colors_for_teams/migration.sql
new file mode 100644
index 0000000000..13a7b753ef
--- /dev/null
+++ b/packages/prisma/migrations/20230131062229_add_theme_and_brand_colors_for_teams/migration.sql
@@ -0,0 +1,4 @@
+-- AlterTable
+ALTER TABLE "Team" ADD COLUMN "brandColor" TEXT NOT NULL DEFAULT '#292929',
+ADD COLUMN "darkBrandColor" TEXT NOT NULL DEFAULT '#fafafa',
+ADD COLUMN "theme" TEXT;
diff --git a/packages/prisma/schema.prisma b/packages/prisma/schema.prisma
index 60aa0ba714..cd6b135753 100644
--- a/packages/prisma/schema.prisma
+++ b/packages/prisma/schema.prisma
@@ -217,6 +217,9 @@ model Team {
createdAt DateTime @default(now())
/// @zod.custom(imports.teamMetadataSchema)
metadata Json?
+ theme String?
+ brandColor String @default("#292929")
+ darkBrandColor String @default("#fafafa")
}
enum MembershipRole {
diff --git a/packages/trpc/server/routers/viewer/teams.tsx b/packages/trpc/server/routers/viewer/teams.tsx
index 5787b42b10..e96543e124 100644
--- a/packages/trpc/server/routers/viewer/teams.tsx
+++ b/packages/trpc/server/routers/viewer/teams.tsx
@@ -125,6 +125,9 @@ export const viewerTeamsRouter = router({
slug: z.string().optional(),
hideBranding: z.boolean().optional(),
hideBookATeamMember: z.boolean().optional(),
+ brandColor: z.string().optional(),
+ darkBrandColor: z.string().optional(),
+ theme: z.string().optional().nullable(),
})
)
.mutation(async ({ ctx, input }) => {
@@ -153,6 +156,9 @@ export const viewerTeamsRouter = router({
bio: input.bio,
hideBranding: input.hideBranding,
hideBookATeamMember: input.hideBookATeamMember,
+ brandColor: input.brandColor,
+ darkBrandColor: input.darkBrandColor,
+ theme: input.theme,
};
if (