diff --git a/tauri-wallet/src-tauri/tauri.conf.json b/tauri-wallet/src-tauri/tauri.conf.json index 54c03151fe..a8c3ca5380 100644 --- a/tauri-wallet/src-tauri/tauri.conf.json +++ b/tauri-wallet/src-tauri/tauri.conf.json @@ -52,8 +52,8 @@ "windows": [ { "title": "nym-wallet", - "width": 800, - "height": 600, + "width": 1920, + "height": 1080, "resizable": true, "fullscreen": false } diff --git a/tauri-wallet/src/routes/sign-in.tsx b/tauri-wallet/src/routes/sign-in.tsx index a771cfb6d6..62fa64aaf4 100644 --- a/tauri-wallet/src/routes/sign-in.tsx +++ b/tauri-wallet/src/routes/sign-in.tsx @@ -1,7 +1,7 @@ import React, { useState } from 'react' import { TextField, - LinearProgress, + CircularProgress, Button, Typography, Grid, @@ -9,21 +9,38 @@ import { Theme, Card, } from '@material-ui/core' +import { Alert } from '@material-ui/lab' import { useTheme } from '@material-ui/styles' import logo from '../images/logo.png' import { useHistory } from 'react-router-dom' import { invoke } from '@tauri-apps/api' export const SignIn = () => { - const handleSignIn = (e: React.FormEvent) => { - e.preventDefault() + const [mnemonic, setMnemonic] = useState('') + const [inputError, setInputError] = useState() + const [isLoading, setIsLoading] = useState(false) - history.push('/bond') - } - - const [loading, setLoading] = useState(false) const theme: Theme = useTheme() const history = useHistory() + + const handleSignIn = async (e: React.FormEvent) => { + e.preventDefault() + + setIsLoading(true) + setInputError(undefined) + + invoke('connect_with_mnemonic', { mnemonic }) + .then((res) => { + setIsLoading(false) + console.log(res) + history.push('/bond') + }) + .catch((e) => { + setIsLoading(false) + setInputError(e) + }) + } + return (
{ ) => + setMnemonic(e.target.value) + } size="medium" variant="outlined" margin="normal" @@ -78,6 +99,7 @@ export const SignIn = () => { name="mnemonic" autoComplete="mnemonic" autoFocus + disabled={isLoading} /> @@ -86,12 +108,18 @@ export const SignIn = () => { variant="contained" color="primary" type="submit" - disabled={loading} + disabled={isLoading} + endIcon={isLoading && } disableElevation > - Sign In + {!isLoading ? 'Sign In' : 'Signing in'} + {inputError && ( + + {inputError} + + )} Don't have an account?