Skip to content

Commit

Permalink
[field] Resolve PT diff component through default components list
Browse files Browse the repository at this point in the history
  • Loading branch information
rexxars committed Oct 6, 2020
1 parent 0aafd3d commit 55964e7
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 5 deletions.
2 changes: 2 additions & 0 deletions packages/@sanity/field/src/diff/resolve/defaultComponents.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,10 @@ import {ReferenceFieldDiff} from '../../types/reference/diff'
import {ImageFieldDiff} from '../../types/image/diff'
import {FileFieldDiff} from '../../types/file/diff'
import {BooleanFieldDiff} from '../../types/boolean/diff'
import {PTDiff} from '../../types/portableText/diff'

export const defaultComponents: {[key: string]: DiffComponent<any> | DiffComponentOptions<any>} = {
block: PTDiff,
string: StringFieldDiff,
number: NumberFieldDiff,
reference: ReferenceFieldDiff,
Expand Down
5 changes: 0 additions & 5 deletions packages/@sanity/field/src/diff/resolve/diffResolver.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import {DatetimeFieldDiff} from '../../types/datetime/diff'
import {UrlFieldDiff} from '../../types/url/diff'
import {SlugFieldDiff} from '../../types/slug/diff'
import {isPTSchemaType, PTDiff} from '../../types/portableText/diff'
import {DiffComponentResolver} from '../../types'

export const diffResolver: DiffComponentResolver = function diffResolver({schemaType}) {
Expand All @@ -18,9 +17,5 @@ export const diffResolver: DiffComponentResolver = function diffResolver({schema
return SlugFieldDiff
}

if (isPTSchemaType(schemaType)) {
return PTDiff
}

return undefined
}

0 comments on commit 55964e7

Please sign in to comment.