Skip to content

Commit

Permalink
refactor(comments): group comment input resources under compose
Browse files Browse the repository at this point in the history
  • Loading branch information
rexxars committed Feb 6, 2024
1 parent e73b32c commit cc31d21
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 13 deletions.
19 changes: 10 additions & 9 deletions packages/sanity/src/structure/comments/i18n/resources.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,15 @@ const commentsLocaleStrings = defineLocalesResources('comments', {
/** The text for the button to go to the correct field */
'button-go-to-field-aria-label': 'Go to field',

/** When composing a comment, the aria label for the button to mention a user */
'compose.mention-user-aria-label': 'Mention user',
/** When composing a comment, the tooltip text for the button to mention a user */
'compose.mention-user-tooltip': 'Mention user',
/** When composing a comment, the aria label for the button to send a comment */
'compose.send-comment-aria-label': 'Send comment',
/** When composing a comment, the tooltip text for the button to send a comment */
'compose.send-comment-tooltip': 'Send comment',

/** The inspector text when error copying link */
'copy-link-error-message': 'Unable to copy link to clipboard',
/** The inspector successfully copied link text */
Expand Down Expand Up @@ -70,7 +79,7 @@ const commentsLocaleStrings = defineLocalesResources('comments', {
/** Text shown in popover when hovering the button above fields to add a comment, when the field currently do not have any comments */
'field-button-title': 'Add comment',

/** The button tooltip content for the add reaction button*/
/** The button tooltip content for the add reaction button */
'list-item-context-menu-add-reaction': 'Add reaction',
/** The button tooltip aria label for adding a reaction */
'list-item-context-menu-add-reaction-aria-label': 'Add reaction',
Expand Down Expand Up @@ -164,14 +173,6 @@ const commentsLocaleStrings = defineLocalesResources('comments', {

/** The thread breadcrumb button aria label */
'thread-breadcrumb-layout-aria-label': 'Go to {{lastCrumb}} field',
/** The tooltip text for mentioning a user */
'tooltip-mention-user': 'Mention user',
/** The tooltip aria label for mentioning a user */
'tooltip-mention-user-aria-label': 'Mention user',
/** The tooltip text for sending a comment*/
'tooltip-send-comment': 'Send comment',
/** The tooltip aria label for sending a comment*/
'tooltip-send-comment-aria-label': 'Send comment',
})

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -123,25 +123,25 @@ export function CommentInputInner(props: CommentInputInnerProps) {
<Flex align="center" data-ui="CommentInputActions" gap={1} justify="flex-end" padding={1}>
<TooltipDelayGroupProvider>
<Button
aria-label={t('tooltip-mention-user-aria-label')}
aria-label={t('compose.mention-user-aria-label')}
data-testid="comment-mention-button"
disabled={readOnly}
icon={MentionIcon}
mode="bleed"
onClick={handleMentionButtonClicked}
tooltipProps={{content: t('tooltip-mention-user')}}
tooltipProps={{content: t('compose.mention-user-tooltip')}}
/>

<ButtonDivider />

<Button
aria-label={t('tooltip-send-comment-aria-label')}
aria-label={t('compose.send-comment-aria-label')}
disabled={!canSubmit || !hasChanges || readOnly}
icon={SendIcon}
mode={hasChanges && canSubmit ? 'default' : 'bleed'}
onClick={onSubmit}
tone={hasChanges && canSubmit ? 'primary' : 'default'}
tooltipProps={{content: t('tooltip-send-comment')}}
tooltipProps={{content: t('compose.send-comment-tooltip')}}
/>
</TooltipDelayGroupProvider>
</Flex>
Expand Down

0 comments on commit cc31d21

Please sign in to comment.