mirror of
https://github.com/grafana/grafana.git
synced 2025-02-25 18:55:37 -06:00
A11y: ARIA hide image/link duplicate in news panel (#36642)
* fix(a11y): Hide image/link duplicate * fix: proper heading and time markup
This commit is contained in:
parent
2fb385c192
commit
b8fbe70c14
@ -80,30 +80,33 @@ export class NewsPanel extends PureComponent<Props, State> {
|
||||
<CustomScrollbar autoHeightMin="100%" autoHeightMax="100%">
|
||||
{news.map((item, index) => {
|
||||
return (
|
||||
<div key={index} className={cx(styles.item, useWideLayout && styles.itemWide)}>
|
||||
<article key={index} className={cx(styles.item, useWideLayout && styles.itemWide)}>
|
||||
{showImage && item.ogImage && (
|
||||
<a
|
||||
href={textUtil.sanitizeUrl(item.link)}
|
||||
target="_blank"
|
||||
rel="noopener noreferrer"
|
||||
className={cx(styles.socialImage, useWideLayout && styles.socialImageWide)}
|
||||
aria-hidden
|
||||
>
|
||||
<img src={item.ogImage} />
|
||||
<img src={item.ogImage} alt={item.title} />
|
||||
</a>
|
||||
)}
|
||||
<div className={styles.body}>
|
||||
<div className={styles.date}>{dateTimeFormat(item.date, { format: 'MMM DD' })} </div>
|
||||
<time className={styles.date} dateTime={dateTimeFormat(item.date, { format: 'MMM DD' })}>
|
||||
{dateTimeFormat(item.date, { format: 'MMM DD' })}{' '}
|
||||
</time>
|
||||
<a
|
||||
className={styles.link}
|
||||
href={textUtil.sanitizeUrl(item.link)}
|
||||
target="_blank"
|
||||
rel="noopener noreferrer"
|
||||
>
|
||||
<div className={styles.title}>{item.title}</div>
|
||||
<h3 className={styles.title}>{item.title}</h3>
|
||||
</a>
|
||||
<div className={styles.content} dangerouslySetInnerHTML={{ __html: textUtil.sanitize(item.content) }} />
|
||||
</div>
|
||||
</div>
|
||||
</article>
|
||||
);
|
||||
})}
|
||||
</CustomScrollbar>
|
||||
|
Loading…
Reference in New Issue
Block a user