add date to claim-preview aria-label

This commit is contained in:
btzr-io 2021-07-15 19:44:51 -05:00
parent d56b32ff19
commit 06e6feaf3b
2 changed files with 9 additions and 1 deletions

View file

@ -9,6 +9,7 @@ import {
makeSelectChannelForClaimUri, makeSelectChannelForClaimUri,
makeSelectClaimIsNsfw, makeSelectClaimIsNsfw,
makeSelectClaimIsStreamPlaceholder, makeSelectClaimIsStreamPlaceholder,
makeSelectDateForUri,
} from 'lbry-redux'; } from 'lbry-redux';
import { selectMutedChannels } from 'redux/selectors/blocked'; import { selectMutedChannels } from 'redux/selectors/blocked';
import { selectBlackListedOutpoints, selectFilteredOutpoints } from 'lbryinc'; import { selectBlackListedOutpoints, selectFilteredOutpoints } from 'lbryinc';
@ -24,6 +25,7 @@ const select = (state, props) => {
return { return {
claim, claim,
mediaDuration, mediaDuration,
date: props.uri && makeSelectDateForUri(props.uri)(state),
channel: props.uri && makeSelectChannelForClaimUri(props.uri)(state), channel: props.uri && makeSelectChannelForClaimUri(props.uri)(state),
isResolvingUri: props.uri && makeSelectIsUriResolving(props.uri)(state), isResolvingUri: props.uri && makeSelectIsUriResolving(props.uri)(state),
thumbnail: props.uri && makeSelectThumbnailForUri(props.uri)(state), thumbnail: props.uri && makeSelectThumbnailForUri(props.uri)(state),

View file

@ -20,6 +20,7 @@ import CollectionPreviewOverlay from 'component/collectionPreviewOverlay';
type Props = { type Props = {
uri: string, uri: string,
date?: any,
claim: ?Claim, claim: ?Claim,
mediaDuration?: string, mediaDuration?: string,
resolveUri: (string) => void, resolveUri: (string) => void,
@ -54,6 +55,7 @@ function ClaimPreviewTile(props: Props) {
const { const {
history, history,
uri, uri,
date,
isResolvingUri, isResolvingUri,
thumbnail, thumbnail,
title, title,
@ -125,8 +127,12 @@ function ClaimPreviewTile(props: Props) {
ariaLabelData += ' ' + __('by %channelTitle%', { channelTitle }); ariaLabelData += ' ' + __('by %channelTitle%', { channelTitle });
} }
if (date) {
ariaLabelData += ' ' + DateTime.getTimeAgoStr(date);
}
if (mediaDuration) { if (mediaDuration) {
ariaLabelData += ' ' + mediaDuration; ariaLabelData += ', ' + mediaDuration;
} }
function handleClick(e) { function handleClick(e) {