@@ -1,6 +1,6 @@
11import React, { useCallback, useMemo, useState } from 'react';
22import cn from 'classnames';
3−import { Grid, Text, Input } from 'indigo-react';
3+import { Grid, Text } from 'indigo-react';
44import * as azimuth from 'azimuth-js';
55
66import { useNetwork } from 'store/network';
@@ -17,11 +17,12 @@ import ViewHeader from 'components/ViewHeader';
1717import InlineEthereumTransaction from 'components/InlineEthereumTransaction';
1818import View from 'components/View';
1919import BridgeForm from 'form/BridgeForm';
20−import { PointInput } from 'form/Inputs';
20+import { PointInput, AddressInput } from 'form/Inputs';
2121import {
2222 composeValidator,
2323 buildPointValidator,
2424 buildAddressValidator,
25+ hasErrors,
2526} from 'form/validators';
2627import FormError from 'form/FormError';
2728
@@ -59,7 +60,7 @@ export default function CreateGalaxy() {
5960 bind,
6061 } = useCreateGalaxy();
6162
62− const validateForm = useCallback(
63+ const validateFormAsync = useCallback(
6364 async values => {
6465 const currentOwner = await azimuth.azimuth.getOwner(
6566 _contracts,
@@ -74,6 +75,17 @@ export default function CreateGalaxy() {
7475 [_contracts]
7576 );
7677
78+ const validateForm = useCallback(
79+ (values, errors) => {
80+ if (hasErrors(errors)) {
81+ return errors;
82+ }
83+
84+ return validateFormAsync(values, errors);
85+ },
86+ [validateFormAsync]
87+ );
88+
7789 const validate = useMemo(
7890 () =>
7991 composeValidator(
@@ -129,7 +141,7 @@ export default function CreateGalaxy() {
129141 />
130142 <Grid.Item
131143 full
132− as={Input}
144+ as={AddressInput}
133145 className="mb4"
134146 name="owner"
135147 label="Ethereum Address"