Browse Source

add option to login upon scanning qr code

feature/qrscanner
Nareshkumar Rao 3 years ago
parent
commit
95d9c7f733
  1. 1
      .gitignore
  2. 3
      src/screens/CreateScreen.js
  3. 4
      src/screens/LoginScreen.js

1
.gitignore

@ -23,3 +23,4 @@
npm-debug.log*
yarn-debug.log*
yarn-error.log*
.env.production

3
src/screens/CreateScreen.js

@ -1,5 +1,6 @@
import {
Button,
Divider,
Flex,
FormControl,
FormLabel,
@ -82,6 +83,8 @@ function Create() {
>
<Flex direction="column" background="white" p={12} rounded={6}>
<Heading mb={6}>Create Account</Heading>
<Button onClick={()=>{history.push("/login");}} mb={6}>I already have an account!</Button>
<Divider mb={6} />
<form onSubmit={handleSubmit}>
<FormControl mb={6}>
<FormLabel>Telegram Username:</FormLabel>

4
src/screens/LoginScreen.js

@ -57,7 +57,11 @@ function Login() {
if (response.data.authorized) {
dispatch(authLogin());
toast.closeAll();
if(response.data.contactSuccess){
history.push('/success');
}else{
history.push('/home');
}
} else {
dispatch(authLogout());
toast({

Loading…
Cancel
Save