Skip to content

Commit a1d0ddf

Browse files
authored
docs: improve naming of consts in usePermissions example (#337)
1 parent a00b9fa commit a1d0ddf

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

packages/react/src/hooks/document/usePermissions.ts

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -25,21 +25,21 @@ import {useSanityInstance} from '../context/useSanityInstance'
2525
* import {publishDocument} from '@sanity/sdk'
2626
*
2727
* export function PublishButton({doc}: {doc: DocumentHandle}) {
28-
* const canPublish = usePermissions(publishDocument(doc))
28+
* const publishPermissions = usePermissions(publishDocument(doc))
2929
* const applyAction = useApplyActions()
3030
*
3131
* return (
3232
* <>
3333
* <button
34-
* disabled={!canPublish.allowed}
34+
* disabled={!publishPermissions.allowed}
3535
* onClick={() => applyAction(publishDocument(doc))}
36-
* popoverTarget={`${canPublish.allowed ? undefined : 'publishButtonPopover'}`}
36+
* popoverTarget={`${publishPermissions.allowed ? undefined : 'publishButtonPopover'}`}
3737
* >
3838
* Publish
3939
* </button>
40-
* {!canPublish.allowed && (
40+
* {!publishPermissions.allowed && (
4141
* <div popover id="publishButtonPopover">
42-
* {canPublish.message}
42+
* {publishPermissions.message}
4343
* </div>
4444
* )}
4545
* </>

0 commit comments

Comments
 (0)