Accessibility: Ensure focus order of post elements matches visual reading order (#39169)
This commit is contained in:
1 parent
1962e4743c
commit
d20d049226
5 files changed
+46
-34
No files matched your search
@@ -20,7 +20,8 @@ export interface StatusHeaderProps {
|
||||
status: Status;
|
||||
account?: Account;
|
||||
avatarSize?: number;
|
||||
children?: ReactNode;
|
||||
contentBeforeDate?: ReactNode;
|
||||
contentAfterDate?: ReactNode;
|
||||
wrapperProps?: HTMLAttributes<HTMLDivElement>;
|
||||
displayNameProps?: DisplayNameProps;
|
||||
onHeaderClick?: MouseEventHandler<HTMLDivElement>;
|
||||
@@ -33,10 +34,11 @@ export type StatusHeaderRenderFn = (args: StatusHeaderProps) => ReactNode;
|
||||
export const StatusHeader: FC<StatusHeaderProps> = ({
|
||||
status,
|
||||
account,
|
||||
children,
|
||||
className,
|
||||
avatarSize = 48,
|
||||
wrapperProps,
|
||||
contentBeforeDate,
|
||||
contentAfterDate,
|
||||
onHeaderClick,
|
||||
}) => {
|
||||
const statusAccount = status.get('account') as Account | undefined;
|
||||
@@ -51,6 +53,14 @@ export const StatusHeader: FC<StatusHeaderProps> = ({
|
||||
className={classNames('status__info', className)}
|
||||
/* eslint-enable jsx-a11y/no-static-element-interactions, jsx-a11y/click-events-have-key-events */
|
||||
>
|
||||
<StatusDisplayName
|
||||
statusAccount={statusAccount}
|
||||
friendAccount={account}
|
||||
avatarSize={avatarSize}
|
||||
/>
|
||||
|
||||
{contentBeforeDate}
|
||||
|
||||
<Link
|
||||
to={`/@${statusAccount?.acct}/${status.get('id') as string}`}
|
||||
className='status__relative-time'
|
||||
@@ -60,13 +70,7 @@ export const StatusHeader: FC<StatusHeaderProps> = ({
|
||||
{editedAt && <StatusEditedAt editedAt={editedAt} />}
|
||||
</Link>
|
||||
|
||||
<StatusDisplayName
|
||||
statusAccount={statusAccount}
|
||||
friendAccount={account}
|
||||
avatarSize={avatarSize}
|
||||
/>
|
||||
|
||||
{children}
|
||||
{contentAfterDate}
|
||||
</div>
|
||||
);
|
||||
};
|
||||
|
||||
@@ -225,17 +225,20 @@ export const QuotedStatus: React.FC<QuotedStatusProps> = ({
|
||||
const intl = useIntl();
|
||||
const headerRenderFn: StatusHeaderRenderFn = useCallback(
|
||||
(props) => (
|
||||
<StatusHeader {...props}>
|
||||
{onQuoteCancel && (
|
||||
<IconButton
|
||||
onClick={onQuoteCancel}
|
||||
className='status__quote-cancel'
|
||||
title={intl.formatMessage(quoteCancelMessage)}
|
||||
icon='cancel-fill'
|
||||
iconComponent={CancelFillIcon}
|
||||
/>
|
||||
)}
|
||||
</StatusHeader>
|
||||
<StatusHeader
|
||||
{...props}
|
||||
contentAfterDate={
|
||||
onQuoteCancel && (
|
||||
<IconButton
|
||||
onClick={onQuoteCancel}
|
||||
className='status__quote-cancel'
|
||||
title={intl.formatMessage(quoteCancelMessage)}
|
||||
icon='cancel-fill'
|
||||
iconComponent={CancelFillIcon}
|
||||
/>
|
||||
)
|
||||
}
|
||||
/>
|
||||
),
|
||||
[intl, onQuoteCancel],
|
||||
);
|
||||
|
||||
Reference in new issue
Block a user