0
0
Fork 0

Change about page to be mounted in the web UI (#19345)

This commit is contained in:
Eugen Rochko 2022-10-13 14:42:37 +02:00 committed by GitHub
parent b04633a961
commit 1bd00036c2
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
37 changed files with 904 additions and 1578 deletions

View file

@ -0,0 +1,33 @@
import React from 'react';
import PropTypes from 'prop-types';
import Blurhash from './blurhash';
import classNames from 'classnames';
export default class Image extends React.PureComponent {
static propTypes = {
src: PropTypes.string,
srcSet: PropTypes.string,
blurhash: PropTypes.string,
className: PropTypes.string,
};
state = {
loaded: false,
};
handleLoad = () => this.setState({ loaded: true });
render () {
const { src, srcSet, blurhash, className } = this.props;
const { loaded } = this.state;
return (
<div className={classNames('image', { loaded }, className)} role='presentation'>
{blurhash && <Blurhash hash={blurhash} className='image__preview' />}
<img src={src} srcSet={srcSet} alt='' onLoad={this.handleLoad} />
</div>
);
}
}