refactor: streamline language initialization and update Container component in HomePage and MyLoansPage

This commit is contained in:
2025-10-26 14:05:54 +01:00
parent bcf93ee9eb
commit 070a390da8
3 changed files with 21 additions and 9 deletions

View File

@@ -46,7 +46,7 @@ export const HomePage = () => {
};
return (
<Container maxW="7xl" className="px-6 sm:px-8 pt-10">
<Container className="px-6 sm:px-8 pt-10">
<Header />
{isMsg && (
<MyAlert
@@ -92,9 +92,7 @@ export const HomePage = () => {
if (response && response.status === "error") {
setMsgStatus("error");
setMsgTitle(response.title || t("error"));
setMsgDescription(
response.description || t("unknown-error")
);
setMsgDescription(response.description || t("unknown-error"));
setIsMsg(true);
return;
}
@@ -147,15 +145,13 @@ export const HomePage = () => {
if (response.status === "error") {
setMsgStatus("error");
setMsgTitle(response.title || t("error"));
setMsgDescription(
response.description || t("unknown-error")
);
setMsgDescription(response.description || t("unknown-error"));
setIsMsg(true);
return;
}
setMsgStatus("success");
setMsgTitle(t("success"));
setMsgDescription(t("loan-success")) ;
setMsgDescription(t("loan-success"));
setIsMsg(true);
})
}