Fix directory scroll position reset (#34560)
This commit is contained in:
parent
05f6f7d28a
commit
e3f0b955b8
2 changed files with 17 additions and 4 deletions
|
@ -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>
|
||||
);
|
||||
};
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue