PR fix front issues

This commit is contained in:
danis
2023-01-28 20:39:54 +03:00
parent 7b4e0ef882
commit 52d5c0eee4
4 changed files with 1 additions and 17 deletions
+1 -6
View File
@@ -6,9 +6,6 @@ import { setAccessToken } from "../state/UserSlice";
import { Center, Button, Text } from 'native-base';
import SigninForm from "../components/forms/signinform";
import SignupForm from "../components/forms/signupform";
import { Provider } from "react-redux";
import store from '../state/Store';
const hanldeSignin = async (username: string, password: string, apiSetter: (accessToken: string) => void): Promise<string> => {
try {
@@ -35,12 +32,11 @@ const AuthenticationView = () => {
const [mode, setMode] = React.useState("signin" as "signin" | "signup");
return (
<Provider store={store}>
<Center style={{ flex: 1 }}>
<Text><Translate translationKey='welcome'/></Text>
{mode === "signin"
? <SigninForm onSubmit={(username, password) => hanldeSignin(username, password, (accessToken) => dispatch(setAccessToken(accessToken)))} />
: <SignupForm onSubmit={(username, password, email) => handleSignup(username, password, email, (accessToken) => dispatch(setAccessToken(accessToken)))} />
: <SignupForm onSubmit={(username, password, email) => handleSignup(username, password, email, (accessToken) => dispatch(setAccessToken(accessToken)))} />
}
{ mode ==="signin" && <Button variant="outline" marginTop={5} colorScheme="error" >{translate("forgottenPassword")}</Button> }
<Button variant='outline' marginTop={5} colorScheme='primary' onPress={() => setMode(mode === "signin" ? "signup" : "signin")}>
@@ -49,7 +45,6 @@ const AuthenticationView = () => {
</Text>
</Button>
</Center>
</Provider>
);
};
@@ -1,3 +0,0 @@
// Jest Snapshot v1, https://goo.gl/fbAQLP
exports[`AuthenticationView Component view should render 1`] = `[Function]`;
@@ -1,3 +0,0 @@
// Jest Snapshot v1, https://goo.gl/fbAQLP
exports[`<HomeView /> Main View should render correctly 1`] = `[Function]`;
@@ -1,5 +0,0 @@
// Jest Snapshot v1, https://goo.gl/fbAQLP
exports[`testing Setting's main view Main View should render correctly 1`] = `[Function]`;
exports[`testing Setting's main view Preference View should render correctly 1`] = `[Function]`;