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 navigate = useNavigate();
const { hostUrl } = useContext<UseAppStoreType>(AppContext);
const { setPage } = useContext<UseAppStoreType>(AppContext);
const { garage } = useContext<UseGarageStoreType>(GarageContext);
const [step, setStep] = useState<'1' | '2' | '3'>('1');

View File

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