Skip to content

Commit

Permalink
[form-builder] Hide array item modal actions
Browse files Browse the repository at this point in the history
  • Loading branch information
mariuslundgard authored and rexxars committed Oct 6, 2020
1 parent 77d1b06 commit 2dbc347
Showing 1 changed file with 24 additions and 24 deletions.
48 changes: 24 additions & 24 deletions packages/@sanity/form-builder/src/inputs/ArrayInput/ItemValue.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -29,23 +29,23 @@ const DragHandle = createDragHandle(() => (
<Button icon={DragHandleIcon} kind="simple" padding="small" />
</span>
))
const CLOSE_ACTION = {
name: 'close',
title: 'Done',
inverted: true
}
const CANCEL_ACTION = {
name: 'close',
title: 'Cancel',
inverted: true
}
const DELETE_ACTION = {
name: 'delete',
title: 'Delete',
color: 'danger',
inverted: true,
secondary: true
}
// const CLOSE_ACTION = {
// name: 'close',
// title: 'Done',
// inverted: true
// }
// const CANCEL_ACTION = {
// name: 'close',
// title: 'Cancel',
// inverted: true
// }
// const DELETE_ACTION = {
// name: 'delete',
// title: 'Delete',
// color: 'danger',
// inverted: true,
// secondary: true
// }
type Props = {
type: ArrayType
value: ItemValue
Expand Down Expand Up @@ -200,11 +200,11 @@ export default class RenderItemValue extends React.PureComponent<Props> {
</div>
)
}
const isItemEmpty = isEmpty(item)
const actions = [
isItemEmpty ? CANCEL_ACTION : CLOSE_ACTION,
!isItemEmpty && !readOnly && DELETE_ACTION
].filter(Boolean)
// const isItemEmpty = isEmpty(item)
// const actions = [
// isItemEmpty ? CANCEL_ACTION : CLOSE_ACTION,
// !isItemEmpty && !readOnly && DELETE_ACTION
// ].filter(Boolean)
if (options.editModal === 'popover') {
return (
<div className={styles.popupAnchor}>
Expand All @@ -213,7 +213,7 @@ export default class RenderItemValue extends React.PureComponent<Props> {
onClose={this.handleEditStop}
onEscape={this.handleEditStop}
onClickOutside={this.handleEditStop}
actions={actions}
// actions={actions}
onAction={this.handleDialogAction}
placement="auto"
>
Expand All @@ -228,7 +228,7 @@ export default class RenderItemValue extends React.PureComponent<Props> {
onClose={this.handleEditStop}
key={item._key}
title={title}
actions={actions}
// actions={actions}
onAction={this.handleDialogAction}
>
<PresenceOverlay>{content}</PresenceOverlay>
Expand Down

0 comments on commit 2dbc347

Please sign in to comment.