Perf hide animated backgrounds

This commit is contained in:
Reckless_Satoshi 2024-01-06 20:59:57 +00:00
parent 9a215693e3
commit fa0781bc36
No known key found for this signature in database
GPG Key ID: 9C4585B561315571
2 changed files with 4 additions and 5 deletions

View File

@ -45,7 +45,7 @@ const Onboarding = ({
const { t } = useTranslation(); const { t } = useTranslation();
const navigate = useNavigate(); const navigate = useNavigate();
const { hostUrl } = useContext<UseAppStoreType>(AppContext); const { setPage } = useContext<UseAppStoreType>(AppContext);
const { garage } = useContext<UseGarageStoreType>(GarageContext); const { garage } = useContext<UseGarageStoreType>(GarageContext);
const [step, setStep] = useState<'1' | '2' | '3'>('1'); const [step, setStep] = useState<'1' | '2' | '3'>('1');

View File

@ -89,7 +89,7 @@ const RobotAvatar: React.FC<Props> = ({
} else { } else {
setActiveBackground(true); setActiveBackground(true);
} }
}, [shortAlias]); // TODO: should hashId }, [shortAlias]);
const statusBadge = ( const statusBadge = (
<div style={{ position: 'relative', left: '0.428em', top: '0.07em' }}> <div style={{ position: 'relative', left: '0.428em', top: '0.07em' }}>
@ -115,8 +115,7 @@ const RobotAvatar: React.FC<Props> = ({
transform: flipHorizontally ? 'scaleX(-1)' : '', transform: flipHorizontally ? 'scaleX(-1)' : '',
border: '0.3px solid #55555', border: '0.3px solid #55555',
filter: 'dropShadow(0.5px 0.5px 0.5px #000000)', filter: 'dropShadow(0.5px 0.5px 0.5px #000000)',
backgroundImage: backgroundImage: activeBackground ? backgroundImage : '',
activeBackground && placeholderType == 'loading' ? backgroundImage : '',
}} }}
> >
<div className={className}> <div className={className}>
@ -147,7 +146,7 @@ const RobotAvatar: React.FC<Props> = ({
/> />
); );
} }
}, [hashId, shortAlias, avatarSrc, statusColor, tooltip, avatarClass]); }, [hashId, shortAlias, avatarSrc, statusColor, tooltip, avatarClass, activeBackground]);
const getAvatarWithBadges = useCallback(() => { const getAvatarWithBadges = useCallback(() => {
let component = avatar; let component = avatar;