From: Yamagishi Kazutoshi Date: Thu, 15 Jun 2017 12:10:41 +0000 (+0900) Subject: Add alt attribute to ImageLoader (#3765) X-Git-Url: https://git.xn--scling-oua.cat.family/?a=commitdiff_plain;h=df4f4e94b3dfb97cc5fc458c86928842f7f396d0;p=mastodon.git Add alt attribute to ImageLoader (#3765) --- diff --git a/app/javascript/mastodon/features/ui/components/image_loader.js b/app/javascript/mastodon/features/ui/components/image_loader.js index b357f28a0..a2514d6be 100644 --- a/app/javascript/mastodon/features/ui/components/image_loader.js +++ b/app/javascript/mastodon/features/ui/components/image_loader.js @@ -4,12 +4,17 @@ import PropTypes from 'prop-types'; class ImageLoader extends React.PureComponent { static propTypes = { + alt: PropTypes.string, src: PropTypes.string.isRequired, previewSrc: PropTypes.string.isRequired, width: PropTypes.number.isRequired, height: PropTypes.number.isRequired, } + static defaultProps = { + alt: '', + }; + state = { loading: true, error: false, @@ -35,12 +40,13 @@ class ImageLoader extends React.PureComponent { } render() { - const { src, previewSrc, width, height } = this.props; + const { alt, src, previewSrc, width, height } = this.props; const { loading, error } = this.state; return (
- {alt} {loading && -