Skip to content

Commit

Permalink
fix: MET-615 fix net page of seach token
Browse files Browse the repository at this point in the history
  • Loading branch information
Sotatek-TrungHoang committed Aug 1, 2023
1 parent 2c45e7f commit e1f5eea
Showing 1 changed file with 8 additions and 5 deletions.
13 changes: 8 additions & 5 deletions src/components/TokenAutocomplete/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -197,6 +197,11 @@ const ModalToken = ({ open, onClose, address }: { open: boolean; onClose: () =>
setSearch("");
};

const handleSearch = () => {
setSearch(value);
setPagination({ page: 0, size: 50 });
};

return (
<CustomModal title="Token List" open={open} onClose={handleClose} width={"min(80vw, 600px)"}>
<>
Expand All @@ -206,19 +211,17 @@ const ModalToken = ({ open, onClose, address }: { open: boolean; onClose: () =>
onChange={(e) => setValue(e.target.value)}
value={value}
onKeyUp={(e) => {
if (e.key === "Enter") {
setSearch(value);
setPagination({ page: 0, size: 50 });
}
if (e.key === "Enter") handleSearch();
}}
/>
<SubmitButton onClick={() => setSearch(value)}>
<SubmitButton onClick={() => handleSearch()}>
<Image src={HeaderSearchIcon} alt="Search" />
</SubmitButton>
</SearchContainer>
<WrappModalScrollBar>
<Table
{...fetchData}
key={search}
data={data || []}
columns={columns}
total={{ title: "Total", count: fetchData.total }}
Expand Down

0 comments on commit e1f5eea

Please sign in to comment.