@@ -1,17 +1,9 @@
1−import { useCallback, useMemo } from 'react';
21import { Image } from '@tlon/indigo-react';
32import BridgeForm from 'form/BridgeForm';
4−import Condition from 'form/Condition';
53import FormError from 'form/FormError';
6−import { HdPathInput } from 'form/Inputs';
74import SubmitButton from 'form/SubmitButton';
8−import {
9− buildCheckboxValidator,
10− buildHdPathValidator,
11− composeValidator,
12−} from 'form/validators';
13−import { CheckboxInput, Grid, Text as LegacyText } from 'indigo-react';
14−import { DEFAULT_HD_PATH, WALLET_TYPES } from 'lib/constants';
5+import { Grid, Text as LegacyText } from 'indigo-react';
6+import { WALLET_TYPES } from 'lib/constants';
157import useLoginView from 'lib/useLoginView';
168import { useWalletConnect } from 'lib/useWalletConnect';
179import { abbreviateAddress } from 'lib/utils/address';
@@ -30,35 +22,8 @@ const WalletConnectLogin = ({ className, goHome }) => {
3022 peerMeta,
3123 } = useWalletConnect();
3224
33− const initialValues = useMemo(
34− () => ({
35− useCustomPath: false,
36− hdPath: DEFAULT_HD_PATH,
37− }),
38− []
39− );
40−
41− const validate = useMemo(
42− () =>
43− composeValidator({
44− useCustomPath: buildCheckboxValidator(),
45− hdPath: buildHdPathValidator(),
46− }),
47− []
48− );
49−
50− const onValues = useCallback(({ valid, values, form }) => {
51− if (!valid) {
52− return;
53− }
54−
55− if (!values.useCustomPath) {
56− form.change('hdPath', DEFAULT_HD_PATH);
57− }
58− }, []);
59−
60− const onSubmit = async (values: typeof initialValues) => {
61− await authenticate({ hdPath: values.hdPath });
25+ const onSubmit = async () => {
26+ await authenticate();
6227 return;
6328 };
6429
@@ -100,33 +65,11 @@ const WalletConnectLogin = ({ className, goHome }) => {
10065 </Grid.Item>
10166 )}
10267
103− <BridgeForm
104− validate={validate}
105− onSubmit={onSubmit}
106− onValues={onValues}
107− afterSubmit={goHome}
108− initialValues={initialValues}>
68+ <BridgeForm onSubmit={onSubmit} afterSubmit={goHome}>
10969 {({ handleSubmit, submitting }) => (
11070 <>
11171 {isConnected() ? (
11272 <>
113− <Grid.Item
114− full
115− as={CheckboxInput}
116− className="mv3"
117− name="useCustomPath"
118− label="Custom HD Path"
119− />
120−
121− <Condition when="useCustomPath" is={true}>
122− <Grid.Item
123− full
124− as={HdPathInput}
125− name="hdPath"
126− label="HD Path"
127− />
128− </Condition>
129−
13073 <Grid.Item full as={FormError} />
13174
13275 <Grid.Item