Skip to content

Commit

Permalink
use same input for badge color & text color
Browse files Browse the repository at this point in the history
  • Loading branch information
trulshj committed Nov 27, 2024
1 parent aaae161 commit b1e638b
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 18 deletions.
2 changes: 1 addition & 1 deletion src/components/customerCases/customerCase/CustomerCase.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ export default async function CustomerCase({
<ColoredTitle
title={customerCase.basicTitle}
colorPart={customerCase.basicTitleColorPart}
color={customerCase.clientColors.title}
color={customerCase.clientColors.color}
/>
<hr className={styles.divider} />
{consultantsResult.ok && (
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ export default async function CustomerCaseProjectInfo({
{projectInfo.customerSectors.map((sector: CustomerSector) => (
<Badge
key={sector._key}
badgeColor={clientColors.badge}
badgeColor={clientColors.color}
textColor={clientColors.badgeText}
>
{sector.customerSector}
Expand Down
3 changes: 1 addition & 2 deletions studioShared/lib/interfaces/customerCases.ts
Original file line number Diff line number Diff line change
Expand Up @@ -61,8 +61,7 @@ export interface CustomerCaseBase {
}

export interface CustomerCaseClientColors {
title?: string;
badge?: string;
color?: string;
badgeText?: string;
}

Expand Down
3 changes: 1 addition & 2 deletions studioShared/lib/queries/customerCases.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,7 @@ const CUSTOMER_CASE_BASE_FRAGMENT = groq`
${INTERNATIONALIZED_IMAGE_FRAGMENT}
},
"clientColors": {
"title": clientColorTitle.hex,
"badge": clientColorBadge.hex,
"color": clientColor.hex,
"badgeText": clientColorBadgeText.hex
}
`;
Expand Down
21 changes: 9 additions & 12 deletions studioShared/schemas/documents/customerCase.ts
Original file line number Diff line number Diff line change
Expand Up @@ -47,25 +47,22 @@ const customerCase = defineType({
}),
defineField({ ...domainsField, validation: (rule) => rule.required() }),
defineField({
name: "clientColorTitle",
name: "clientColor",
type: "color",
title: "Client Color (Title)",
description: "This color will be used for parts of the title",
options: { disableAlpha: true },
}),
defineField({
name: "clientColorBadge",
type: "color",
title: "Client Color (Badge)",
description: "This color will be used for the badges under project info",
title: "Client Color (Title & Badges)",
description: "This color will be used for parts of the title and badges",
options: { disableAlpha: true },
}),
defineField({
name: "clientColorBadgeText",
type: "color",
title: "Client Color (Badge Text)",
description: "This color will be used for the text on the badges",
options: { disableAlpha: true },
description:
"This color will be used for the text on the badges. There are predefined colors for text in the component",
options: {
disableAlpha: true,
colorList: ["#222424", "#faf8f5"],
},
}),
defineField({
name: "description",
Expand Down

0 comments on commit b1e638b

Please sign in to comment.