Skip to content

Commit

Permalink
[components] Remove use of DialogContent
Browse files Browse the repository at this point in the history
  • Loading branch information
mariuslundgard authored and rexxars committed Oct 6, 2020
1 parent bd0d640 commit beadb0f
Showing 1 changed file with 18 additions and 21 deletions.
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import React from 'react'
import {PresenceOverlay, FieldPresence} from '@sanity/base/presence'
import Dialog from 'part:@sanity/components/dialogs/default'
import DialogContent from 'part:@sanity/components/dialogs/content'
import Button from 'part:@sanity/components/buttons/default'
import {setIfMissing} from 'part:@sanity/form-builder/patch-event'
import {FormBuilderInput} from 'part:@sanity/form-builder'
Expand All @@ -24,27 +23,25 @@ export const CustomInputWithDialogOverlay = React.forwardRef(function CustomInpu
return (
<>
{isOpen && (
<Dialog onClose={() => setIsOpen(false)}>
<Dialog onClose={() => setIsOpen(false)} padding="medium">
<PresenceOverlay>
<DialogContent padding="medium">
<div style={{padding: 10}}>
{type.fields.map((field, i) => (
// Delegate to the generic FormBuilderInput. It will resolve and insert the actual input component
// for the given field type
<FormBuilderInput
level={level + 1}
key={field.name}
type={field.type}
value={value && value[field.name]}
onChange={patchEvent => handleFieldChange(field, patchEvent)}
path={[field.name]}
focusPath={focusPath}
onFocus={onFocus}
onBlur={onBlur}
/>
))}
</div>
</DialogContent>
<div style={{padding: 10}}>
{type.fields.map((field, i) => (
// Delegate to the generic FormBuilderInput. It will resolve and insert the actual input component
// for the given field type
<FormBuilderInput
level={level + 1}
key={field.name}
type={field.type}
value={value && value[field.name]}
onChange={patchEvent => handleFieldChange(field, patchEvent)}
path={[field.name]}
focusPath={focusPath}
onFocus={onFocus}
onBlur={onBlur}
/>
))}
</div>
</PresenceOverlay>
</Dialog>
)}
Expand Down

0 comments on commit beadb0f

Please sign in to comment.