Skip to content

Commit

Permalink
refactor(comments): group status filter resources
Browse files Browse the repository at this point in the history
  • Loading branch information
rexxars committed Feb 6, 2024
1 parent 7492d72 commit 09877bf
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 13 deletions.
18 changes: 9 additions & 9 deletions packages/sanity/src/structure/comments/i18n/resources.ts
Original file line number Diff line number Diff line change
Expand Up @@ -57,15 +57,6 @@ const commentsLocaleStrings = defineLocalesResources('comments', {
/** The text for discard comment dialog */
'discard-text': 'Do you want to discard the comment?',

/** The text for dropdown menu item for open comments */
'dropdown-item-open': 'Open comments',
/** The text for dropdown menu item for resolved comments */
'dropdown-item-resolved': 'Resolved comments',
/** The title for dropdown for open comments */
'dropdown-title-open': 'Open',
/** The title for dropdown for resolved comments */
'dropdown-title-resolved': 'Resolved',

/** The name of the comments feature, for use in header. Capitalized, eg "Comments". */
'feature-name': 'Comments',

Expand Down Expand Up @@ -172,6 +163,15 @@ const commentsLocaleStrings = defineLocalesResources('comments', {
*/
'reactions.users-reacted-with-reaction': '<UserList/> <Text>reacted with</Text> <ReactionName/>',

/** Status filter: The short title describing filtering on open (non-resolved) comments */
'status-filter.status-open': 'Open',
/** Status filter: The full text for describing filtering on open (non-resolved) comments */
'status-filter.status-open-full': 'Open comments',
/** Status filter: The short title describing filtering on resolved comments */
'status-filter.status-resolved': 'Resolved',
/** Status filter: The full text for describing filtering on resolved comments */
'status-filter.status-resolved-full': 'Resolved comments',

/** The thread breadcrumb button aria label */
'thread-breadcrumb-layout-aria-label': 'Go to {{lastCrumb}} field',
})
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,22 +45,26 @@ export const CommentsInspectorHeader = forwardRef(function CommentsInspectorHead
id="comment-status-menu-button"
button={
<Button
text={view === 'open' ? t('dropdown-title-open') : t('dropdown-title-resolved')}
text={
view === 'open'
? t('status-filter.status-open')
: t('status-filter.status-resolved')
}
mode="bleed"
iconRight={ChevronDownIcon}
/>
} //this startcase needs to be fixed
}
menu={
<Menu style={{width: '180px'}}>
<MenuItem
iconRight={view === 'open' ? CheckmarkIcon : undefined}
onClick={handleSetOpenView}
text={t('dropdown-item-open')}
text={t('status-filter.status-open-full')}
/>
<MenuItem
iconRight={view === 'resolved' ? CheckmarkIcon : undefined}
onClick={handleSetResolvedView}
text={t('dropdown-item-resolved')}
text={t('status-filter.status-resolved-full')}
/>
</Menu>
}
Expand Down

0 comments on commit 09877bf

Please sign in to comment.