Replace left pane button aria-label
This commit is contained in:
parent
5d42997e79
commit
0bf351ba09
3 changed files with 20 additions and 15 deletions
|
@ -373,24 +373,21 @@ export function ConversationList({
|
|||
]);
|
||||
const { badges, title, unreadCount, lastMessage } = itemProps;
|
||||
result = (
|
||||
<div
|
||||
aria-label={i18n('icu:ConversationList__aria-label', {
|
||||
<ConversationListItem
|
||||
{...itemProps}
|
||||
buttonAriaLabel={i18n('icu:ConversationList__aria-label', {
|
||||
lastMessage:
|
||||
get(lastMessage, 'text') ||
|
||||
i18n('icu:ConversationList__last-message-undefined'),
|
||||
title,
|
||||
unreadCount,
|
||||
})}
|
||||
>
|
||||
<ConversationListItem
|
||||
{...itemProps}
|
||||
key={key}
|
||||
badge={getPreferredBadge(badges)}
|
||||
onClick={onSelectConversation}
|
||||
i18n={i18n}
|
||||
theme={theme}
|
||||
/>
|
||||
</div>
|
||||
key={key}
|
||||
badge={getPreferredBadge(badges)}
|
||||
onClick={onSelectConversation}
|
||||
i18n={i18n}
|
||||
theme={theme}
|
||||
/>
|
||||
);
|
||||
break;
|
||||
}
|
||||
|
|
|
@ -33,6 +33,7 @@ const CHECKBOX_CLASS_NAME = `${BASE_CLASS_NAME}__checkbox`;
|
|||
export const SPINNER_CLASS_NAME = `${BASE_CLASS_NAME}__spinner`;
|
||||
|
||||
type PropsType = {
|
||||
buttonAriaLabel?: string;
|
||||
checked?: boolean;
|
||||
conversationType: 'group' | 'direct';
|
||||
disabled?: boolean;
|
||||
|
@ -79,6 +80,7 @@ export const BaseConversationListItem: FunctionComponent<PropsType> =
|
|||
acceptedMessageRequest,
|
||||
avatarPath,
|
||||
avatarSize,
|
||||
buttonAriaLabel,
|
||||
checked,
|
||||
color,
|
||||
conversationType,
|
||||
|
@ -250,9 +252,12 @@ export const BaseConversationListItem: FunctionComponent<PropsType> =
|
|||
if (onClick) {
|
||||
return (
|
||||
<button
|
||||
aria-label={i18n('icu:BaseConversationListItem__aria-label', {
|
||||
title,
|
||||
})}
|
||||
aria-label={
|
||||
buttonAriaLabel ||
|
||||
i18n('icu:BaseConversationListItem__aria-label', {
|
||||
title,
|
||||
})
|
||||
}
|
||||
className={classNames(
|
||||
commonClassNames,
|
||||
`${BASE_CLASS_NAME}--is-button`
|
||||
|
|
|
@ -68,6 +68,7 @@ export type PropsData = Pick<
|
|||
};
|
||||
|
||||
type PropsHousekeeping = {
|
||||
buttonAriaLabel?: string;
|
||||
i18n: LocalizerType;
|
||||
onClick: (id: string) => void;
|
||||
theme: ThemeType;
|
||||
|
@ -80,6 +81,7 @@ export const ConversationListItem: FunctionComponent<Props> = React.memo(
|
|||
acceptedMessageRequest,
|
||||
avatarPath,
|
||||
badge,
|
||||
buttonAriaLabel,
|
||||
color,
|
||||
draftPreview,
|
||||
groupId,
|
||||
|
@ -193,6 +195,7 @@ export const ConversationListItem: FunctionComponent<Props> = React.memo(
|
|||
acceptedMessageRequest={acceptedMessageRequest}
|
||||
avatarPath={avatarPath}
|
||||
badge={badge}
|
||||
buttonAriaLabel={buttonAriaLabel}
|
||||
color={color}
|
||||
conversationType={type}
|
||||
groupId={groupId}
|
||||
|
|
Loading…
Add table
Reference in a new issue