Skip to content

Commit

Permalink
[desk-tool] fix color function in boolean diff
Browse files Browse the repository at this point in the history
  • Loading branch information
vicmeow authored and rexxars committed Oct 6, 2020
1 parent 83d068c commit 7a6bbd9
Showing 1 changed file with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -3,17 +3,17 @@ import {
DiffComponent,
BooleanDiff,
DiffAnnotationTooltip,
useAnnotationColor
useDiffAnnotationColor
} from '@sanity/field/diff'
import ArrowIcon from 'part:@sanity/base/arrow-right'
import {Checkbox, Switch} from './BooleanInput'
import styles from './BooleanFieldDiff.css'

export const BooleanFieldDiff /* : DiffComponent<BooleanDiff> */ = ({diff, schemaType}) => {
const {fromValue, toValue, annotation} = diff
export const BooleanFieldDiff: DiffComponent<BooleanDiff> = ({diff, schemaType}) => {
const {fromValue, toValue} = diff
const {title, options} = schemaType
const Input = options?.layout === 'checkbox' ? Checkbox : Switch
const userColor = useAnnotationColor(annotation)
const userColor = useDiffAnnotationColor(diff, []) || {background: '', text: '', border: ''}
return (
<DiffAnnotationTooltip as="div" className={styles.root} diff={diff}>
<Input checked={fromValue} color={userColor} />
Expand Down

0 comments on commit 7a6bbd9

Please sign in to comment.