11/*
22Copyright 2016 OpenMarket Ltd
3+ Copyright 2019 The Matrix.org Foundation C.I.C.
34
45Licensed under the Apache License, Version 2.0 (the "License");
56you may not use this file except in compliance with the License.
@@ -19,6 +20,7 @@ import PropTypes from 'prop-types';
1920import createReactClass from 'create-react-class' ;
2021import { linkifyElement } from '../../../HtmlUtils' ;
2122import SettingsStore from "../../../settings/SettingsStore" ;
23+ import { _t } from "../../../languageHandler" ;
2224
2325const sdk = require ( '../../../index' ) ;
2426const MatrixClientPeg = require ( '../../../MatrixClientPeg' ) ;
@@ -125,6 +127,7 @@ module.exports = createReactClass({
125127 </ div > ;
126128 }
127129
130+ const AccessibleButton = sdk . getComponent ( 'elements.AccessibleButton' ) ;
128131 return (
129132 < div className = "mx_LinkPreviewWidget" >
130133 { img }
@@ -135,9 +138,10 @@ module.exports = createReactClass({
135138 { p [ "og:description" ] }
136139 </ div >
137140 </ div >
138- < img className = "mx_LinkPreviewWidget_cancel mx_filterFlipColor"
139- src = { require ( "../../../../res/img/cancel.svg" ) } width = "18" height = "18"
140- onClick = { this . props . onCancelClick } />
141+ < AccessibleButton className = "mx_LinkPreviewWidget_cancel" onClick = { this . props . onCancelClick } aria-label = { _t ( "Close preview" ) } >
142+ < img className = "mx_filterFlipColor" alt = "" role = "presentation"
143+ src = { require ( "../../../../res/img/cancel.svg" ) } width = "18" height = "18" />
144+ </ AccessibleButton >
141145 </ div >
142146 ) ;
143147 } ,
0 commit comments