Merge branch 'gallery-load-more' into 'develop'

Fix load more button height on account gallery page

See merge request soapbox-pub/soapbox!2318
This commit is contained in:
marcin mikołajczak 2023-03-10 10:52:00 +00:00
commit 51524118d4
2 changed files with 5 additions and 4 deletions

View file

@ -6,16 +6,17 @@ import { Button } from 'soapbox/components/ui';
interface ILoadMore { interface ILoadMore {
onClick: React.MouseEventHandler onClick: React.MouseEventHandler
disabled?: boolean disabled?: boolean
visible?: Boolean visible?: boolean
className?: string
} }
const LoadMore: React.FC<ILoadMore> = ({ onClick, disabled, visible = true }) => { const LoadMore: React.FC<ILoadMore> = ({ onClick, disabled, visible = true, className }) => {
if (!visible) { if (!visible) {
return null; return null;
} }
return ( return (
<Button theme='primary' block disabled={disabled || !visible} onClick={onClick}> <Button className={className} theme='primary' block disabled={disabled || !visible} onClick={onClick}>
<FormattedMessage id='status.load_more' defaultMessage='Load more' /> <FormattedMessage id='status.load_more' defaultMessage='Load more' />
</Button> </Button>
); );

View file

@ -121,7 +121,7 @@ const AccountGallery = () => {
let loadOlder = null; let loadOlder = null;
if (hasMore && !(isLoading && attachments.size === 0)) { if (hasMore && !(isLoading && attachments.size === 0)) {
loadOlder = <LoadMore visible={!isLoading} onClick={handleLoadOlder} />; loadOlder = <LoadMore className='my-auto' visible={!isLoading} onClick={handleLoadOlder} />;
} }
if (unavailable) { if (unavailable) {