update es build

This commit is contained in:
Proddy
2023-03-26 22:56:43 +02:00
parent 17b108597e
commit d2d29afcbe
24 changed files with 542 additions and 626 deletions

View File

@@ -30,6 +30,8 @@ import { ReactComponent as TRflag } from 'i18n/TR.svg';
const SignIn: FC = () => {
const authenticationContext = useContext(AuthenticationContext);
const { LL, setLocale, locale } = useContext(I18nContext);
const [signInRequest, setSignInRequest] = useState<SignInRequest>({
username: '',
password: ''
@@ -39,20 +41,6 @@ const SignIn: FC = () => {
const updateLoginRequestValue = updateValue(setSignInRequest);
const validateAndSignIn = async () => {
setProcessing(true);
SIGN_IN_REQUEST_VALIDATOR.messages({
required: LL.IS_REQUIRED('%s')
});
try {
await validate(SIGN_IN_REQUEST_VALIDATOR, signInRequest);
signIn();
} catch (errors: any) {
setFieldErrors(errors);
setProcessing(false);
}
};
const signIn = async () => {
try {
const { data: loginResponse } = await AuthenticationApi.signIn(signInRequest);
@@ -69,9 +57,21 @@ const SignIn: FC = () => {
}
};
const submitOnEnter = onEnterCallback(signIn);
const validateAndSignIn = async () => {
setProcessing(true);
SIGN_IN_REQUEST_VALIDATOR.messages({
required: LL.IS_REQUIRED('%s')
});
try {
await validate(SIGN_IN_REQUEST_VALIDATOR, signInRequest);
signIn();
} catch (errors: any) {
setFieldErrors(errors);
setProcessing(false);
}
};
const { LL, setLocale, locale } = useContext(I18nContext);
const submitOnEnter = onEnterCallback(signIn);
const selectLocale = async (loc: Locales) => {
localStorage.setItem('lang', loc);