Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

refactor: remove unused useConditionalReadOnly hook #4902

Merged
merged 1 commit into from
Sep 7, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

Original file line number Diff line number Diff line change
@@ -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
Loading