Fix directory scroll position reset (#34560)

This commit is contained in:
Patryk Rzucidło 2025-04-30 14:27:37 +02:00 committed by GitHub
parent 05f6f7d28a
commit e3f0b955b8
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 17 additions and 4 deletions

View file

@ -1,24 +1,32 @@
import { FormattedMessage } from 'react-intl';
import { LoadingIndicator } from './loading_indicator';
interface Props {
onClick: (event: React.MouseEvent) => void;
disabled?: boolean;
visible?: boolean;
loading?: boolean;
}
export const LoadMore: React.FC<Props> = ({
onClick,
disabled,
visible = true,
loading = false,
}) => {
return (
<button
type='button'
className='load-more'
disabled={disabled || !visible}
disabled={disabled || loading || !visible}
style={{ visibility: visible ? 'visible' : 'hidden' }}
onClick={onClick}
>
<FormattedMessage id='status.load_more' defaultMessage='Load more' />
{loading ? (
<LoadingIndicator />
) : (
<FormattedMessage id='status.load_more' defaultMessage='Load more' />
)}
</button>
);
};