Add margin to LoadMore button

Signed-off-by: marcin mikołajczak <git@mkljczk.pl>
This commit is contained in:
marcin mikołajczak 2024-08-26 00:37:00 +02:00
parent 4b489ed524
commit 6144b47349
11 changed files with 14 additions and 1 deletions

View file

@ -75,6 +75,8 @@ interface IScrollableList extends VirtuosoProps<any, any> {
listClassName?: string;
/** Class names on each item container. */
itemClassName?: string;
/** Extra class names on the LoadMore element */
loadMoreClassName?: string;
/** `id` attribute on the Virtuoso element. */
id?: string;
/** CSS styles on the Virtuoso element. */
@ -100,6 +102,7 @@ const ScrollableList = React.forwardRef<VirtuosoHandle, IScrollableList>(({
className,
listClassName,
itemClassName,
loadMoreClassName,
id,
hasMore,
placeholderComponent: Placeholder,
@ -195,7 +198,7 @@ const ScrollableList = React.forwardRef<VirtuosoHandle, IScrollableList>(({
if (autoloadMore || !hasMore || !onLoadMore) {
return null;
} else {
return <LoadMore visible={!isLoading} onClick={onLoadMore} />;
return <LoadMore className={loadMoreClassName} visible={!isLoading} onClick={onLoadMore} />;
}
};

View file

@ -110,6 +110,7 @@ const Bookmarks: React.FC<IBookmarks> = ({ params }) => {
<PullToRefresh onRefresh={handleRefresh}>
<StatusList
className='black:p-0 black:sm:p-4'
loadMoreClassName='black:sm:mx-4'
statusIds={statusIds}
scrollKey='bookmarked_statuses'
hasMore={hasMore}

View file

@ -39,6 +39,7 @@ const BubbleTimeline = () => {
<PullToRefresh onRefresh={handleRefresh}>
<Timeline
className='black:p-0 black:sm:p-4'
loadMoreClassName='black:sm:mx-4'
scrollKey={`${timelineId}_timeline`}
timelineId={`${timelineId}${onlyMedia ? ':media' : ''}`}
prefix='home'

View file

@ -42,6 +42,7 @@ const CommunityTimeline = () => {
<PullToRefresh onRefresh={handleRefresh}>
<Timeline
className='black:p-0 black:sm:p-4'
loadMoreClassName='black:sm:mx-4'
scrollKey={`${timelineId}_timeline`}
timelineId={`${timelineId}${onlyMedia ? ':media' : ''}`}
prefix='home'

View file

@ -62,6 +62,7 @@ const HashtagTimeline: React.FC<IHashtagTimeline> = ({ params }) => {
)}
<Timeline
className='black:p-0 black:sm:p-4'
loadMoreClassName='black:sm:mx-4'
scrollKey='hashtag_timeline'
timelineId={`hashtag:${tagId}`}
onLoadMore={handleLoadMore}

View file

@ -63,6 +63,7 @@ const HomeTimeline: React.FC = () => {
<PullToRefresh onRefresh={handleRefresh}>
<Timeline
className='black:p-0 black:sm:p-4'
loadMoreClassName='black:sm:mx-4'
scrollKey='home_timeline'
onLoadMore={handleLoadMore}
timelineId='home'

View file

@ -49,6 +49,7 @@ const LandingTimeline = () => {
<PullToRefresh onRefresh={handleRefresh}>
<Timeline
className='black:p-0 black:sm:p-4'
loadMoreClassName='black:sm:mx-4'
scrollKey={`${timelineId}_timeline`}
timelineId={timelineId}
prefix='home'

View file

@ -104,6 +104,7 @@ const ListTimeline: React.FC = () => {
>
<Timeline
className='black:p-0 black:sm:p-4'
loadMoreClassName='black:sm:mx-4'
scrollKey='list_timeline'
timelineId={`list:${id}`}
onLoadMore={handleLoadMore}

View file

@ -87,6 +87,7 @@ const CommunityTimeline = () => {
<PullToRefresh onRefresh={handleRefresh}>
<Timeline
className='black:p-0 black:sm:p-4'
loadMoreClassName='black:sm:mx-4'
scrollKey={`${timelineId}_timeline`}
timelineId={`${timelineId}${onlyMedia ? ':media' : ''}`}
prefix='home'

View file

@ -40,6 +40,7 @@ const Quotes: React.FC = () => {
<Column label={intl.formatMessage(messages.heading)} transparent={!isMobile}>
<StatusList
className='black:p-0 black:sm:p-4'
loadMoreClassName='black:sm:mx-4'
statusIds={statusIds as ImmutableOrderedSet<string>}
scrollKey={`quotes:${statusId}`}
hasMore={hasMore}

View file

@ -67,6 +67,7 @@ const RemoteTimeline: React.FC<IRemoteTimeline> = ({ params }) => {
<Timeline
className='black:p-0 black:sm:p-4'
loadMoreClassName='black:sm:mx-4'
scrollKey={`${timelineId}_${instance}_timeline`}
timelineId={`${timelineId}${onlyMedia ? ':media' : ''}:${instance}`}
onLoadMore={handleLoadMore}