Merge branch 'fix-effect' into 'next'
Remove conditional to run style logic See merge request soapbox-pub/soapbox-fe!1142
This commit is contained in:
commit
e0b1abdfc0
3 changed files with 16 additions and 26 deletions
|
@ -94,18 +94,16 @@ const Account = ({
|
||||||
};
|
};
|
||||||
|
|
||||||
React.useEffect(() => {
|
React.useEffect(() => {
|
||||||
if (isOnScreen) {
|
const style: React.CSSProperties = {};
|
||||||
const style: React.CSSProperties = {};
|
const actionWidth = actionRef.current?.clientWidth;
|
||||||
const actionWidth = actionRef.current?.clientWidth;
|
|
||||||
|
|
||||||
if (overflowRef.current) {
|
if (overflowRef.current) {
|
||||||
style.maxWidth = overflowRef.current.clientWidth - 30 - avatarSize - actionWidth;
|
style.maxWidth = overflowRef.current.clientWidth - 30 - avatarSize - actionWidth;
|
||||||
} else {
|
} else {
|
||||||
style.visibility = 'hidden';
|
style.visibility = 'hidden';
|
||||||
}
|
|
||||||
|
|
||||||
setStyle(style);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
setStyle(style);
|
||||||
}, [isOnScreen, overflowRef, actionRef]);
|
}, [isOnScreen, overflowRef, actionRef]);
|
||||||
|
|
||||||
if (!account) {
|
if (!account) {
|
||||||
|
|
|
@ -105,19 +105,15 @@ class Followers extends ImmutablePureComponent {
|
||||||
|
|
||||||
if (accountId === -1 || (!accountIds)) {
|
if (accountId === -1 || (!accountIds)) {
|
||||||
return (
|
return (
|
||||||
<Column>
|
<Spinner />
|
||||||
<Spinner />
|
|
||||||
</Column>
|
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (unavailable) {
|
if (unavailable) {
|
||||||
return (
|
return (
|
||||||
<Column>
|
<div className='empty-column-indicator'>
|
||||||
<div className='empty-column-indicator'>
|
<FormattedMessage id='empty_column.account_unavailable' defaultMessage='Profile unavailable' />
|
||||||
<FormattedMessage id='empty_column.account_unavailable' defaultMessage='Profile unavailable' />
|
</div>
|
||||||
</div>
|
|
||||||
</Column>
|
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -105,19 +105,15 @@ class Following extends ImmutablePureComponent {
|
||||||
|
|
||||||
if (accountId === -1 || (!accountIds)) {
|
if (accountId === -1 || (!accountIds)) {
|
||||||
return (
|
return (
|
||||||
<Column>
|
<Spinner />
|
||||||
<Spinner />
|
|
||||||
</Column>
|
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (unavailable) {
|
if (unavailable) {
|
||||||
return (
|
return (
|
||||||
<Column>
|
<div className='empty-column-indicator'>
|
||||||
<div className='empty-column-indicator'>
|
<FormattedMessage id='empty_column.account_unavailable' defaultMessage='Profile unavailable' />
|
||||||
<FormattedMessage id='empty_column.account_unavailable' defaultMessage='Profile unavailable' />
|
</div>
|
||||||
</div>
|
|
||||||
</Column>
|
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue