Eugen Rochko 64fc79cbc2 [Glitch] Change design of modal loading and error screens in web UI
Port 7f2cfcccab8d81feca98328e371373a9dd7f7c12 to glitch-soc

Signed-off-by: Claire <claire.github-309c@sitedethib.com>
2024-12-01 18:47:56 +01:00

23 lines
595 B
TypeScript

import { useHovering } from '@/hooks/useHovering';
import { autoPlayGif } from 'flavours/glitch/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}
/>
);
};