Rename file: use-last-visible-item => use-get-last-visible-slot

No functional change, just renaming for clarity.
This commit is contained in:
infinite-persistence 2022-04-18 16:59:59 +08:00
parent 82f278dbde
commit f5a0f39f59
No known key found for this signature in database
GPG key ID: B9C3252EDC3D0AA0
3 changed files with 5 additions and 5 deletions

View file

@ -7,7 +7,7 @@ import ClaimPreview from 'component/claimPreview';
import Spinner from 'component/spinner'; import Spinner from 'component/spinner';
import { FormField } from 'component/common/form'; import { FormField } from 'component/common/form';
import usePersistedState from 'effects/use-persisted-state'; import usePersistedState from 'effects/use-persisted-state';
import useLastVisibleItem from 'effects/use-last-visible-item'; import useGetLastVisibleSlot from 'effects/use-get-last-visible-slot';
import debounce from 'util/debounce'; import debounce from 'util/debounce';
import ClaimPreviewTile from 'component/claimPreviewTile'; import ClaimPreviewTile from 'component/claimPreviewTile';
@ -106,7 +106,7 @@ export default function ClaimList(props: Props) {
// Resolve the index for injectedItem, if provided; else injectedIndex will be 'undefined'. // Resolve the index for injectedItem, if provided; else injectedIndex will be 'undefined'.
const listRef = React.useRef(); const listRef = React.useRef();
const injectedIndex = useLastVisibleItem(injectedItem, listRef); const injectedIndex = useGetLastVisibleSlot(injectedItem, listRef);
// Exclude prefix uris in these results variables. We don't want to show // Exclude prefix uris in these results variables. We don't want to show
// anything if the search failed or timed out. // anything if the search failed or timed out.

View file

@ -5,7 +5,7 @@ import Button from 'component/button';
import ClaimPreviewTile from 'component/claimPreviewTile'; import ClaimPreviewTile from 'component/claimPreviewTile';
import I18nMessage from 'component/i18nMessage'; import I18nMessage from 'component/i18nMessage';
import useFetchViewCount from 'effects/use-fetch-view-count'; import useFetchViewCount from 'effects/use-fetch-view-count';
import useLastVisibleItem from 'effects/use-last-visible-item'; import useGetLastVisibleSlot from 'effects/use-get-last-visible-slot';
import useResolvePins from 'effects/use-resolve-pins'; import useResolvePins from 'effects/use-resolve-pins';
import useGetUserMemberships from 'effects/use-get-user-memberships'; import useGetUserMemberships from 'effects/use-get-user-memberships';
@ -93,7 +93,7 @@ function ClaimTilesDiscover(props: Props) {
} = props; } = props;
const listRef = React.useRef(); const listRef = React.useRef();
const injectedIndex = useLastVisibleItem(injectedItem, listRef); const injectedIndex = useGetLastVisibleSlot(injectedItem, listRef);
const prevUris = React.useRef(); const prevUris = React.useRef();
const claimSearchUris = claimSearchResults || []; const claimSearchUris = claimSearchResults || [];

View file

@ -10,7 +10,7 @@ type InjectedItem = { node: Node, index?: number, replace?: boolean };
* @param listRef - A reference to the claim-grid * @param listRef - A reference to the claim-grid
* @returns {number} * @returns {number}
*/ */
export default function useLastVisibleItem(injectedItem: ?InjectedItem, listRef: any) { export default function useGetLastVisibleSlot(injectedItem: ?InjectedItem, listRef: any) {
const [injectedIndex, setInjectedIndex] = React.useState(injectedItem?.index); const [injectedIndex, setInjectedIndex] = React.useState(injectedItem?.index);
React.useEffect(() => { React.useEffect(() => {