Skip to content

Commit

Permalink
feat: adds option for light/dark mode for contact box
Browse files Browse the repository at this point in the history
  • Loading branch information
mikaelbr committed Nov 29, 2024
1 parent 11f5360 commit f653bb2
Show file tree
Hide file tree
Showing 4 changed files with 26 additions and 1 deletion.
1 change: 1 addition & 0 deletions src/components/sections/contact-box/ContactBox.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ export default async function ContactBox({
? result.value.map((e) => employeeAndTag(e, section.contactPoints))
: [],
);

return (
<section className={styles.contactBox}>
<div>
Expand Down
2 changes: 2 additions & 0 deletions src/components/sections/contact-box/contact-box.module.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
.contactBox {
}
1 change: 1 addition & 0 deletions studio/lib/interfaces/pages.ts
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,7 @@ export interface ContactBoxSection {
_key: string;
basicTitle: string;
optionalSubtitle?: string;
designMode: "light" | "dark";
contactPoints: {
_key: string;
_type: string;
Expand Down
23 changes: 22 additions & 1 deletion studio/schemas/objects/sections/contact-box.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,16 @@ import { firstTranslation } from "studio/utils/i18n";

export const contactBoxID = "contactBox";

export enum ContacxtBoxDesignMode {
Dark = "dark",
Light = "light",
}

const designModeOptions = [
{ title: "Dark", value: ContacxtBoxDesignMode.Dark },
{ title: "Light", value: ContacxtBoxDesignMode.Light },
];

export const contactBox = defineField({
name: contactBoxID,
title: "Contact Box",
Expand All @@ -24,7 +34,18 @@ export const contactBox = defineField({
title: "Subtitle",
description: "Extra context under the main title.",
},

{
name: "designMode",
title: "Design Mode",
type: "string",
description:
"Select the whether the contact box should be light or dark.",
options: {
list: designModeOptions,
layout: "radio",
},
initialValue: ContacxtBoxDesignMode.Dark,
},
{
name: "contactPoints",
title: "List of people to contact",
Expand Down

0 comments on commit f653bb2

Please sign in to comment.