Skip to content

Commit

Permalink
update useElven
Browse files Browse the repository at this point in the history
  • Loading branch information
juliancwirko committed May 14, 2023
1 parent 77c9683 commit 973907c
Show file tree
Hide file tree
Showing 3 changed files with 310 additions and 288 deletions.
13 changes: 4 additions & 9 deletions components/tools/LoginComponent.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
// Login component wraps all auth services in one place
// You can always use only one of them if needed
import { useCallback, memo, useState } from 'react';
import { Box, Stack } from '@chakra-ui/react';
import { Box, Stack, Text } from '@chakra-ui/react';
import { useLogin, LoginMethodsEnum } from '@useelven/core';
import { WalletConnectQRCode } from './WalletConnectQRCode';
import { WalletConnectPairings } from './WalletConnectPairings';
Expand All @@ -21,7 +21,6 @@ export const LoginComponent = memo(() => {
walletConnectPairingLogin,
walletConnectPairings,
walletConnectRemovePairing,
setLoggingInState,
} = useLogin({ token: 'token_just_for_testing_purposes' });

const [loginMethod, setLoginMethod] = useState<LoginMethodsEnum>();
Expand All @@ -42,17 +41,13 @@ export const LoginComponent = memo(() => {
setLoginMethod(undefined);
}, []);

const backToOptions = useCallback(() => {
setLoggingInState('error', '');
}, [setLoggingInState]);

if (error)
return (
<Stack>
<Box textAlign="center">{error}</Box>
<ActionButton isFullWidth onClick={backToOptions}>
Back
</ActionButton>
<Text textAlign="center" pt={4} fontWeight={700}>
Close and try again
</Text>
</Stack>
);

Expand Down
Loading

0 comments on commit 973907c

Please sign in to comment.