Skip to content

Commit

Permalink
sticky asset search
Browse files Browse the repository at this point in the history
  • Loading branch information
jonator committed Jul 8, 2024
1 parent 5dab4e3 commit ff17f0d
Showing 1 changed file with 4 additions and 6 deletions.
10 changes: 4 additions & 6 deletions packages/web/components/bridge/asset-select-screen.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ export const AssetSelectScreen = observer(
const canLoadMore = !isLoading && !isFetchingNextPage && hasNextPage;

return (
<div className="flex h-full flex-col">
<>
<ActivateUnverifiedTokenConfirmation
coinDenom={assetToActivate?.coinDenom}
coinImageUrl={assetToActivate?.coinImageUrl}
Expand Down Expand Up @@ -138,12 +138,12 @@ export const AssetSelectScreen = observer(
onInput={debounce((nextValue) => {
setSearch(nextValue);
}, 300)}
className="my-4 flex-shrink-0 md:w-full"
className="sticky top-0 my-4 flex-shrink-0 md:w-full"
placeholder={t("transfer.assetSelectScreen.searchAssets")}
size={isMobile ? "small" : "full"}
/>

<div className="flex h-full flex-col gap-1 overflow-y-scroll">
<div className="flex flex-col gap-1">
{isLoading ? (
<div className="self-center pt-3">
<Spinner />
Expand Down Expand Up @@ -217,9 +217,7 @@ export const AssetSelectScreen = observer(
<Intersection
className="-mt-20"
onVisible={() => {
console.log("on visible");
if (canLoadMore) {
console.log("fetchNextPage");
fetchNextPage();
}
}}
Expand All @@ -232,7 +230,7 @@ export const AssetSelectScreen = observer(
</>
)}
</div>
</div>
</>
);
}
);

0 comments on commit ff17f0d

Please sign in to comment.