Merge pull request #293 from getmaxun/ui

chore: login translation switcher
This commit is contained in:
Karishma
2024-12-24 03:10:39 +05:30
committed by GitHub

View File

@@ -46,18 +46,15 @@ const Login = () => {
password, password,
}); });
dispatch({ type: "LOGIN", payload: data }); dispatch({ type: "LOGIN", payload: data });
notify("success", t('login.welcome_notification')); // Translated notification notify("success", t('login.welcome_notification'));
window.localStorage.setItem("user", JSON.stringify(data)); window.localStorage.setItem("user", JSON.stringify(data));
navigate("/"); navigate("/");
} catch (err) { } catch (err) {
notify("error", t('login.error_notification')); // Translated error notify("error", t('login.error_notification'));
setLoading(false); setLoading(false);
} }
}; };
// Language switcher function
return ( return (
<Box <Box
sx={{ sx={{
@@ -69,8 +66,6 @@ const Login = () => {
padding: 4, padding: 4,
}} }}
> >
{/* Language Switcher Buttons */}
<Box <Box
component="form" component="form"
onSubmit={submitForm} onSubmit={submitForm}