Skip to content

Commit

Permalink
refactor(comments): group + clarify purpose of mention resources
Browse files Browse the repository at this point in the history
  • Loading branch information
rexxars committed Feb 6, 2024
1 parent e93633c commit 67f3573
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 9 deletions.
12 changes: 6 additions & 6 deletions packages/sanity/src/structure/comments/i18n/resources.ts
Original file line number Diff line number Diff line change
Expand Up @@ -124,12 +124,12 @@ const commentsLocaleStrings = defineLocalesResources('comments', {
/** The list status message for loading status */
'list-status-loading': 'Loading comments',

/** The text for no users found for mentions */
'mentions-not-found': 'No users found',
/** The text for unauthorized mentions */
'mentions-unauthorized': 'Unauthorized',
/** The aria label for the command list for users to mention */
'mentions-user-list-aria-label': 'List of users to mention',
/** Text shown when no users can be found to mention */
'mentions.no-users-found': 'No users found',
/** Label/badge shown for users that are not authorized to see the document, and thus cannot be mentioned */
'mentions.unauthorized-user': 'Unauthorized',
/** Aria label for the command list for users to mention */
'mentions.user-list-aria-label': 'List of users to mention',

/** The comments onboarding popover text */
'onboarding-popover-body':
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ export const MentionsMenu = React.forwardRef(function MentionsMenu(
{filteredOptions.length === 0 && (
<Box padding={5}>
<Text align="center" size={1} muted>
{t('mentions-not-found')}
{t('mentions.no-users-found')}
</Text>
</Box>
)}
Expand All @@ -122,7 +122,7 @@ export const MentionsMenu = React.forwardRef(function MentionsMenu(
<FlexWrap direction="column" flex={1} overflow="hidden">
<CommandList
activeItemDataAttr="data-hovered"
ariaLabel={t('mentions-user-list-aria-label')}
ariaLabel={t('mentions.user-list-aria-label')}
fixedHeight
getItemDisabled={getItemDisabled}
inputElement={_inputElement}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ export function MentionsMenuItem(props: MentionsItemProps) {

{!user.canBeMentioned && (
<Badge fontSize={1} mode="outline">
{t('mentions-unauthorized')}
{t('mentions.unauthorized-user')}
</Badge>
)}
</Flex>
Expand Down

0 comments on commit 67f3573

Please sign in to comment.