Skip to content

Commit

Permalink
Rewrite <LoadPending /> as FC and TS (mastodon#25363)
Browse files Browse the repository at this point in the history
  • Loading branch information
alfe committed Jun 11, 2023
1 parent 432a5d2 commit dfaf59d
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 24 deletions.
23 changes: 0 additions & 23 deletions app/javascript/mastodon/components/load_pending.jsx

This file was deleted.

18 changes: 18 additions & 0 deletions app/javascript/mastodon/components/load_pending.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
import { FormattedMessage } from 'react-intl';

interface Props {
onClick: (event: React.MouseEvent) => void;
count: number;
}

export const LoadPending: React.FC<Props> = ({ onClick, count }) => {
return (
<button className='load-more load-gap' onClick={onClick}>
<FormattedMessage
id='load_pending'
defaultMessage='{count, plural, one {# new item} other {# new items}}'
values={{ count }}
/>
</button>
);
};
2 changes: 1 addition & 1 deletion app/javascript/mastodon/components/scrollable_list.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ import { attachFullscreenListener, detachFullscreenListener, isFullscreen } from
import IntersectionObserverWrapper from '../features/ui/util/intersection_observer_wrapper';

import { LoadMore } from './load_more';
import LoadPending from './load_pending';
import { LoadPending } from './load_pending';
import LoadingIndicator from './loading_indicator';

const MOUSE_IDLE_DELAY = 300;
Expand Down

0 comments on commit dfaf59d

Please sign in to comment.