From d3976c56d015934badf7d5047eabcaa1234aed31 Mon Sep 17 00:00:00 2001 From: Drew Lyton Date: Wed, 2 Oct 2024 10:28:29 +0200 Subject: [PATCH] chore(structure): cleanup RequestPermissionDialog comments --- .../RequestPermissionDialog.tsx | 10 ++++------ .../__telemetry__/RequestPermissionDialog.telemetry.ts | 5 +---- 2 files changed, 5 insertions(+), 10 deletions(-) diff --git a/packages/sanity/src/structure/components/requestPermissionDialog/RequestPermissionDialog.tsx b/packages/sanity/src/structure/components/requestPermissionDialog/RequestPermissionDialog.tsx index 715e1fa30b2..54d2558ac38 100644 --- a/packages/sanity/src/structure/components/requestPermissionDialog/RequestPermissionDialog.tsx +++ b/packages/sanity/src/structure/components/requestPermissionDialog/RequestPermissionDialog.tsx @@ -34,9 +34,9 @@ export interface RequestPermissionDialogProps { } /** - * A confirmation dialog used to prevent unwanted document deletes. Loads all - * the referencing internal and cross-data references prior to showing the - * delete button. + * A dialog that enables the user to request permission to change their + * member role from "Viewer" to "Editor" or "Admin" depending on the + * project's available roles. * * @internal */ @@ -55,7 +55,6 @@ export function RequestPermissionDialog({ const [isSubmitting, setIsSubmitting] = useState(false) const [note, setNote] = useState('') - const [noteLength, setNoteLength] = useState(0) const [msgError, setMsgError] = useState() const [hasTooManyRequests, setHasTooManyRequests] = useState(false) @@ -169,11 +168,10 @@ export function RequestPermissionDialog({ value={note} onChange={(e) => { setNote(e.currentTarget.value) - setNoteLength(e.currentTarget.value.length) }} /> - {`${noteLength}/${MAX_NOTE_LENGTH}`} + {`${note.length}/${MAX_NOTE_LENGTH}`} )} diff --git a/packages/sanity/src/structure/components/requestPermissionDialog/__telemetry__/RequestPermissionDialog.telemetry.ts b/packages/sanity/src/structure/components/requestPermissionDialog/__telemetry__/RequestPermissionDialog.telemetry.ts index a3e03104bb6..0d211d98051 100644 --- a/packages/sanity/src/structure/components/requestPermissionDialog/__telemetry__/RequestPermissionDialog.telemetry.ts +++ b/packages/sanity/src/structure/components/requestPermissionDialog/__telemetry__/RequestPermissionDialog.telemetry.ts @@ -1,9 +1,6 @@ import {defineEvent} from '@sanity/telemetry' -/** - * When a draft in a live edit document is published - * @internal - */ +/** @internal */ export const AskToEditDialogOpened = defineEvent({ name: 'Ask To Edit Dialog Opened', version: 1,