Improve a11y labels
This commit is contained in:
@@ -278,7 +278,9 @@ export function PublicationCard({
|
|||||||
<Link
|
<Link
|
||||||
shouldProxy
|
shouldProxy
|
||||||
to={view.source.uri}
|
to={view.source.uri}
|
||||||
label={l`View publication`}
|
label={
|
||||||
|
view.source.title ? l`View ${view.source.title}` : l`View publication`
|
||||||
|
}
|
||||||
onPress={onPress}
|
onPress={onPress}
|
||||||
onLongPress={onLongPress}
|
onLongPress={onLongPress}
|
||||||
{...web({
|
{...web({
|
||||||
@@ -317,12 +319,7 @@ export function PublicationCard({
|
|||||||
<View style={[a.flex_1, a.gap_2xs]}>
|
<View style={[a.flex_1, a.gap_2xs]}>
|
||||||
<Text
|
<Text
|
||||||
numberOfLines={1}
|
numberOfLines={1}
|
||||||
style={[
|
style={[a.text_md, a.font_semi_bold, t.atoms.text]}>
|
||||||
a.text_md,
|
|
||||||
a.font_semi_bold,
|
|
||||||
t.atoms.text,
|
|
||||||
interacted && a.underline,
|
|
||||||
]}>
|
|
||||||
{view.source?.title}
|
{view.source?.title}
|
||||||
</Text>
|
</Text>
|
||||||
<StandardSiteMetaRow type="publication" view={view} />
|
<StandardSiteMetaRow type="publication" view={view} />
|
||||||
@@ -382,12 +379,21 @@ export function SubscribeButton({
|
|||||||
|
|
||||||
if (!view.source) return null
|
if (!view.source) return null
|
||||||
|
|
||||||
|
const publicationTitle = view.source.title
|
||||||
|
const label = highlightedPublisher
|
||||||
|
? publicationTitle
|
||||||
|
? l`Subscribe to ${publicationTitle} on ${highlightedPublisher.name}`
|
||||||
|
: l`Subscribe on ${highlightedPublisher.name}`
|
||||||
|
: publicationTitle
|
||||||
|
? l`View ${publicationTitle}`
|
||||||
|
: l`View publication`
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<StandardSiteThemeProvider view={view}>
|
<StandardSiteThemeProvider view={view}>
|
||||||
<Link
|
<Link
|
||||||
shouldProxy
|
shouldProxy
|
||||||
to={view.source.uri}
|
to={view.source.uri}
|
||||||
label={cta}
|
label={label}
|
||||||
size="small"
|
size="small"
|
||||||
color="secondary_inverted"
|
color="secondary_inverted"
|
||||||
style={[style, a.gap_sm, a.pointer_events_auto]}
|
style={[style, a.gap_sm, a.pointer_events_auto]}
|
||||||
@@ -491,7 +497,9 @@ export function PublicationFooter({
|
|||||||
<Link
|
<Link
|
||||||
shouldProxy
|
shouldProxy
|
||||||
to={view.source.uri}
|
to={view.source.uri}
|
||||||
label={l`View publication`}
|
label={
|
||||||
|
view.source.title ? l`View ${view.source.title}` : l`View publication`
|
||||||
|
}
|
||||||
onPress={onPress}
|
onPress={onPress}
|
||||||
onLongPress={onLongPress}
|
onLongPress={onLongPress}
|
||||||
style={[a.absolute, a.inset_0, web({outline: 0})]}
|
style={[a.absolute, a.inset_0, web({outline: 0})]}
|
||||||
|
|||||||
Reference in New Issue
Block a user