Skip to content

Commit

Permalink
Merge branch 'bose/2151' into staging
Browse files Browse the repository at this point in the history
  • Loading branch information
BorghildSelle committed Mar 7, 2024
2 parents f1b2114 + 426a350 commit df66277
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 13 deletions.
27 changes: 15 additions & 12 deletions sanityv3/schemas/components/ColorSelector/ColorSelector.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,9 @@ const InnerCircle = styled.div<{ color: string }>`
export type ColorSelectorValue = {
title: string
value: string
dark: boolean
key: string
dark?: boolean
key?: string
onlyTextColor?: boolean
}

type ColorCircleProps = {
Expand Down Expand Up @@ -77,16 +78,18 @@ export const ColorSelector = ({ value, onChange, schemaType }: ColorSelectorProp
{colors && (
<Card>
<Flex direction={'row'} wrap={'wrap'}>
{colors.map((colorItem: ColorSelectorValue) => {
return (
<ColorCircle
key={colorItem.value}
color={colorItem}
active={colorItem.value === value?.value}
onClickHandler={handleSelect}
/>
)
})}
{colors
.filter((colorItem: ColorSelectorValue) => !colorItem?.onlyTextColor)
.map((colorItem: ColorSelectorValue) => {
return (
<ColorCircle
key={colorItem.value}
color={colorItem}
active={colorItem.value === value?.value}
onClickHandler={handleSelect}
/>
)
})}
</Flex>
</Card>
)}
Expand Down
2 changes: 1 addition & 1 deletion sanityv3/schemas/defaultColors.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,5 +24,5 @@ export const defaultColors = [
{ title: 'Mid Orange', value: colors.orange[50], key: 'orange-50', dark: false },
{ title: 'Mid Blue', value: colors.blue[50], key: 'blue-50', dark: true },
{ title: 'Mid Green', value: colors.green[50], key: 'green-50', dark: false },
{ title: 'Energy Red', value: colors['energy-red'][100], key: 'energy-red-50', dark: false },
{ title: 'Energy Red', value: colors['energy-red'][100], key: 'energy-red-50', dark: false, onlyTextColor: true },
]

0 comments on commit df66277

Please sign in to comment.