Skip to content

Commit

Permalink
refactor: Replace Mantines Autocomplete by rollups-explorer-ui Applic…
Browse files Browse the repository at this point in the history
…ationAutocomplete.
  • Loading branch information
brunomenezes committed Dec 13, 2024
1 parent 1a63b8e commit 0e1c5dc
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 5 deletions.
11 changes: 6 additions & 5 deletions apps/web/src/components/connection/connectionForm.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
"use client";
import { ApplicationAutocomplete } from "@cartesi/rollups-explorer-ui";
import {
Alert,
Autocomplete,
Button,
Flex,
List,
Expand Down Expand Up @@ -145,8 +145,6 @@ const AppConnectionForm: FC<AppConnectionFormProps> = ({
chainId,
});

const applicationAddressList = applications.map((a) => a.address);

const showLoader = !isEmpty(debouncedAddress) && fetching;

const { validURL } = React.useMemo(
Expand Down Expand Up @@ -215,15 +213,18 @@ const AppConnectionForm: FC<AppConnectionFormProps> = ({
})}
>
<Flex direction="column" gap="sm">
<Autocomplete
<ApplicationAutocomplete
withAsterisk
label="Address"
description="The application smart contract address."
rightSection={showLoader ? <Loader size="sm" /> : ""}
placeholder="0x"
data={applicationAddressList}
applications={applications}
data-testid="connection-address"
{...form.getInputProps("address")}
onApplicationSelected={(app) => {
form.setFieldValue("address", app.address);
}}
/>

{isAddress(address) && !applications.length && !fetching && (
Expand Down
1 change: 1 addition & 0 deletions packages/ui/src/index.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
export { AddressRelayForm } from "./AddressRelayForm";
export { default as ApplicationAutocomplete } from "./ApplicationAutocomplete";
export { type TransactionFormSuccessData } from "./DepositFormTypes";
export { ERC1155DepositForm } from "./ERC1155DepositForm";
export { ERC20DepositForm } from "./ERC20DepositForm";
Expand Down

0 comments on commit 0e1c5dc

Please sign in to comment.