0
0
Fork 0

Use Prettier for ESLint formatting TypeScript (#23631)

This commit is contained in:
Nick Schonning 2023-05-09 13:02:12 -04:00 committed by GitHub
parent 6aeb162927
commit 51b83ed195
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
31 changed files with 407 additions and 245 deletions

View file

@ -7,9 +7,14 @@ type Props = {
srcSet?: string;
blurhash?: string;
className?: string;
}
};
export const Image: React.FC<Props> = ({ src, srcSet, blurhash, className }) => {
export const Image: React.FC<Props> = ({
src,
srcSet,
blurhash,
className,
}) => {
const [loaded, setLoaded] = useState(false);
const handleLoad = useCallback(() => {
@ -17,7 +22,10 @@ export const Image: React.FC<Props> = ({ src, srcSet, blurhash, className }) =>
}, [setLoaded]);
return (
<div className={classNames('image', { loaded }, className)} role='presentation'>
<div
className={classNames('image', { loaded }, className)}
role='presentation'
>
{blurhash && <Blurhash hash={blurhash} className='image__preview' />}
<img src={src} srcSet={srcSet} alt='' onLoad={handleLoad} />
</div>