fix profile cover error state
This commit is contained in:
parent
4fc9619636
commit
9ba0a132b8
1 changed files with 5 additions and 2 deletions
|
|
@ -48,6 +48,8 @@ export function UserHeroCover({
|
|||
bannerUrl?: string;
|
||||
hasStatus: boolean;
|
||||
}) {
|
||||
const [err, setError] = useState(false);
|
||||
|
||||
return (
|
||||
<div
|
||||
className={css.UserHeroCoverContainer}
|
||||
|
|
@ -56,15 +58,16 @@ export function UserHeroCover({
|
|||
filter: bannerUrl && !hasStatus ? undefined : 'brightness(50%)',
|
||||
}}
|
||||
>
|
||||
{bannerUrl && (
|
||||
{!err && bannerUrl && (
|
||||
<img
|
||||
className={classNames(
|
||||
css.UserHeroCover,
|
||||
avatarUrl === bannerUrl && css.UserHeroCoverBlurred
|
||||
)}
|
||||
src={bannerUrl}
|
||||
alt={userId}
|
||||
alt="{userId}"
|
||||
draggable="false"
|
||||
onError={() => setError(true)}
|
||||
/>
|
||||
)}
|
||||
</div>
|
||||
|
|
|
|||
Loading…
Reference in a new issue