From 929907de6fbdda5f3ca15068a217f639774634ed Mon Sep 17 00:00:00 2001 From: Drew Lyton Date: Thu, 26 Sep 2024 11:46:02 -0400 Subject: [PATCH] feat: update zOffsets --- .../RequestPermissionDialog.tsx | 119 +++++++++--------- 1 file changed, 61 insertions(+), 58 deletions(-) diff --git a/packages/sanity/src/structure/components/requestPermissionDialog/RequestPermissionDialog.tsx b/packages/sanity/src/structure/components/requestPermissionDialog/RequestPermissionDialog.tsx index 00428f7c71a..67183c94f5e 100644 --- a/packages/sanity/src/structure/components/requestPermissionDialog/RequestPermissionDialog.tsx +++ b/packages/sanity/src/structure/components/requestPermissionDialog/RequestPermissionDialog.tsx @@ -1,6 +1,6 @@ -import {Box, Card, Flex, Stack, Text, TextInput, useToast} from '@sanity/ui' +import {Box, Card, DialogProvider, Flex, Stack, Text, TextInput, useToast} from '@sanity/ui' import {useEffect, useId, useMemo, useState} from 'react' -import {type Role, useClient, useProjectId, useTranslation} from 'sanity' +import {type Role, useClient, useProjectId, useTranslation, useZIndex} from 'sanity' import {styled} from 'styled-components' import {Dialog} from '../../../ui-components' @@ -58,6 +58,7 @@ export function RequestPermissionDialog({ const projectId = useProjectId() const client = useClient({apiVersion: '2024-09-26'}) const toast = useToast() + const zOffset = useZIndex() const [isSubmitting, setIsSubmitting] = useState(false) @@ -126,61 +127,63 @@ export function RequestPermissionDialog({ } return ( - - - - {t('request-permission-dialog.description.text')} - {hasTooManyRequests || hasBeenDenied ? ( - - - {hasTooManyRequests && ( - <>{msgError ?? t('request-permission-dialog.warning.limit-reached.text')} - )} - {hasBeenDenied && ( - <>{msgError ?? t('request-permission-dialog.warning.denied.text')} - )} - - - ) : ( - - { - if (e.key === 'Enter') onConfirm() - }} - maxLength={MAX_NOTE_LENGTH} - value={note} - onChange={(e) => { - setNote(e.currentTarget.value) - setNoteLength(e.currentTarget.value.length) - }} - /> - - {`${noteLength}/${MAX_NOTE_LENGTH}`} - - )} - - - + + + + + {t('request-permission-dialog.description.text')} + {hasTooManyRequests || hasBeenDenied ? ( + + + {hasTooManyRequests && ( + <>{msgError ?? t('request-permission-dialog.warning.limit-reached.text')} + )} + {hasBeenDenied && ( + <>{msgError ?? t('request-permission-dialog.warning.denied.text')} + )} + + + ) : ( + + { + if (e.key === 'Enter') onConfirm() + }} + maxLength={MAX_NOTE_LENGTH} + value={note} + onChange={(e) => { + setNote(e.currentTarget.value) + setNoteLength(e.currentTarget.value.length) + }} + /> + + {`${noteLength}/${MAX_NOTE_LENGTH}`} + + )} + + + + ) }