Remove conditional to run style logic

merge-requests/1142/head
Justin 2022-03-24 12:16:41 -04:00
rodzic 97af1ece28
commit 63bafc41a1
3 zmienionych plików z 16 dodań i 26 usunięć

Wyświetl plik

@ -94,18 +94,16 @@ const Account = ({
};
React.useEffect(() => {
if (isOnScreen) {
const style: React.CSSProperties = {};
const actionWidth = actionRef.current?.clientWidth;
const style: React.CSSProperties = {};
const actionWidth = actionRef.current?.clientWidth;
if (overflowRef.current) {
style.maxWidth = overflowRef.current.clientWidth - 30 - avatarSize - actionWidth;
} else {
style.visibility = 'hidden';
}
setStyle(style);
if (overflowRef.current) {
style.maxWidth = overflowRef.current.clientWidth - 30 - avatarSize - actionWidth;
} else {
style.visibility = 'hidden';
}
setStyle(style);
}, [isOnScreen, overflowRef, actionRef]);
if (!account) {

Wyświetl plik

@ -105,19 +105,15 @@ class Followers extends ImmutablePureComponent {
if (accountId === -1 || (!accountIds)) {
return (
<Column>
<Spinner />
</Column>
<Spinner />
);
}
if (unavailable) {
return (
<Column>
<div className='empty-column-indicator'>
<FormattedMessage id='empty_column.account_unavailable' defaultMessage='Profile unavailable' />
</div>
</Column>
<div className='empty-column-indicator'>
<FormattedMessage id='empty_column.account_unavailable' defaultMessage='Profile unavailable' />
</div>
);
}

Wyświetl plik

@ -105,19 +105,15 @@ class Following extends ImmutablePureComponent {
if (accountId === -1 || (!accountIds)) {
return (
<Column>
<Spinner />
</Column>
<Spinner />
);
}
if (unavailable) {
return (
<Column>
<div className='empty-column-indicator'>
<FormattedMessage id='empty_column.account_unavailable' defaultMessage='Profile unavailable' />
</div>
</Column>
<div className='empty-column-indicator'>
<FormattedMessage id='empty_column.account_unavailable' defaultMessage='Profile unavailable' />
</div>
);
}