0
0
Fork 0

Change design of modal loading and error screens in web UI (#33092)

This commit is contained in:
Eugen Rochko 2024-11-29 08:50:08 +01:00 committed by GitHub
parent eef8d2c855
commit 7f2cfcccab
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
8 changed files with 118 additions and 234 deletions

View file

@ -0,0 +1,22 @@
import { useHovering } from '@/hooks/useHovering';
import { autoPlayGif } from 'mastodon/initial_state';
export const GIF: React.FC<{
src: string;
staticSrc: string;
className: string;
animate?: boolean;
}> = ({ src, staticSrc, className, animate = autoPlayGif }) => {
const { hovering, handleMouseEnter, handleMouseLeave } = useHovering(animate);
return (
<img
className={className}
src={hovering || animate ? src : staticSrc}
alt=''
role='presentation'
onMouseEnter={handleMouseEnter}
onMouseLeave={handleMouseLeave}
/>
);
};