Skip to content

Commit

Permalink
refactor: remove unused useConditionalReadOnly hook (#4902)
Browse files Browse the repository at this point in the history
  • Loading branch information
rexxars committed Sep 7, 2023
1 parent a7523a6 commit b99e332
Show file tree
Hide file tree
Showing 6 changed files with 2 additions and 64 deletions.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

@@ -1,7 +1,6 @@
import React, {useCallback, useMemo, useState} from 'react'
import {Stack, Box, Button, Text, Grid, useClickOutside} from '@sanity/ui'
import {ObjectSchemaType} from '@sanity/types'
import {useConditionalReadOnly} from '../../conditional-property/conditionalReadOnly'
import {useDocumentOperation} from '../../../hooks'
import {FieldChangeNode, FieldOperationsAPI} from '../../types'
import {undoChange} from '../changes/undoChange'
Expand All @@ -25,7 +24,6 @@ export function FieldChange(
} & React.HTMLAttributes<HTMLDivElement>,
) {
const {change, hidden, readOnly} = props
const conditionalReadOnly = useConditionalReadOnly() ?? readOnly
const DiffComponent = change.diffComponent || FallbackDiff
const {
documentId,
Expand Down Expand Up @@ -131,7 +129,7 @@ export function FieldChange(
onMouseEnter={handleRevertButtonMouseEnter}
onMouseLeave={handleRevertButtonMouseLeave}
selected={confirmRevertOpen}
disabled={conditionalReadOnly}
disabled={readOnly}
data-testid={`single-change-revert-button-${change?.key}`}
/>
</Box>
Expand All @@ -144,7 +142,7 @@ export function FieldChange(
[
change,
closeRevertChangesConfirmDialog,
conditionalReadOnly,
readOnly,
confirmRevertOpen,
DiffComponent,
FieldWrapper,
Expand Down

2 comments on commit b99e332

@vercel
Copy link

@vercel vercel bot commented on b99e332 Sep 7, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Successfully deployed to the following URLs:

performance-studio – ./

performance-studio.sanity.build
performance-studio-git-next.sanity.build

@vercel
Copy link

@vercel vercel bot commented on b99e332 Sep 7, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Successfully deployed to the following URLs:

test-studio – ./

test-studio-git-next.sanity.build
test-studio.sanity.build

Please sign in to comment.