provide language
parent
c967a494d8
commit
c47271ac04
74
src/App.js
74
src/App.js
|
@ -60,14 +60,9 @@ export function Loading() {
|
||||||
}
|
}
|
||||||
|
|
||||||
export default function App() {
|
export default function App() {
|
||||||
/*const [notificationApi, notificationContextHolder] =
|
|
||||||
notification.useNotification();
|
|
||||||
*/
|
|
||||||
const { _, i18n } = useTranslation();
|
const { _, i18n } = useTranslation();
|
||||||
|
|
||||||
const { userSession, setUserSession } = UseUserSession();
|
const { userSession, setUserSession } = UseUserSession();
|
||||||
//const [isWebSocketReady, setIsWebSocketReady] = useState(false);
|
|
||||||
|
|
||||||
const [appUserData, setAppUserData] = useState(null);
|
const [appUserData, setAppUserData] = useState(null);
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
|
@ -135,72 +130,3 @@ export default function App() {
|
||||||
</Layout>
|
</Layout>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
|
||||||
<WebSocketProvider
|
|
||||||
userSession={userSession}
|
|
||||||
setUserSession={setUserSession}
|
|
||||||
isWebSocketReady={isWebSocketReady}
|
|
||||||
setIsWebSocketReady={setIsWebSocketReady}
|
|
||||||
notificationApi={notificationApi}
|
|
||||||
>
|
|
||||||
<ReconnectingView isWebSocketReady={isWebSocketReady} />
|
|
||||||
|
|
||||||
<DashboardLayout
|
|
||||||
userSession={userSession}
|
|
||||||
setUserSession={setUserSession}
|
|
||||||
/>
|
|
||||||
</WebSocketProvider>
|
|
||||||
*/
|
|
||||||
|
|
||||||
/*
|
|
||||||
const ReconnectingView = ({ isWebSocketReady }) => {
|
|
||||||
return (
|
|
||||||
<div
|
|
||||||
style={{
|
|
||||||
position: "fixed",
|
|
||||||
top: 0,
|
|
||||||
left: 0,
|
|
||||||
right: 0,
|
|
||||||
bottom: 0,
|
|
||||||
backgroundColor: "rgba(0, 0, 0, 0.8)",
|
|
||||||
display: isWebSocketReady ? "none" : "block",
|
|
||||||
justifyContent: "center",
|
|
||||||
alignItems: "center",
|
|
||||||
zIndex: 9999,
|
|
||||||
}}
|
|
||||||
>
|
|
||||||
<svg id="loading-reconnecting" className="loading" viewBox="0 0 1350 600">
|
|
||||||
<text x="50%" y="50%" fill="transparent" textAnchor="middle">
|
|
||||||
C O M P A N Y
|
|
||||||
</text>
|
|
||||||
</svg>
|
|
||||||
<div
|
|
||||||
style={{
|
|
||||||
height: "100vh",
|
|
||||||
display: "flex",
|
|
||||||
alignItems: "center",
|
|
||||||
justifyContent: "center",
|
|
||||||
}}
|
|
||||||
>
|
|
||||||
<span
|
|
||||||
style={{
|
|
||||||
marginTop: 80,
|
|
||||||
fontWeight: "bold",
|
|
||||||
fontSize: 24,
|
|
||||||
letterSpacing: 2,
|
|
||||||
}}
|
|
||||||
>
|
|
||||||
Connecting...
|
|
||||||
</span>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
);
|
|
||||||
}; */
|
|
||||||
|
|
||||||
// TODO: Undo this
|
|
||||||
/*
|
|
||||||
<text x="50%" y="50%" fill="transparent" textAnchor="middle">
|
|
||||||
J A N N E X
|
|
||||||
</text>
|
|
||||||
*/
|
|
||||||
|
|
|
@ -16,7 +16,7 @@ import { useTranslation } from "react-i18next";
|
||||||
import MyAppLogo from "../../Components/MyAppLogo";
|
import MyAppLogo from "../../Components/MyAppLogo";
|
||||||
|
|
||||||
export default function Login() {
|
export default function Login() {
|
||||||
const { t } = useTranslation();
|
const { t, i18n } = useTranslation();
|
||||||
const [form] = Form.useForm();
|
const [form] = Form.useForm();
|
||||||
|
|
||||||
const [notificationApi, notificationContextHolder] =
|
const [notificationApi, notificationContextHolder] =
|
||||||
|
@ -62,6 +62,7 @@ export default function Login() {
|
||||||
|
|
||||||
if (selectedMethod === "2") {
|
if (selectedMethod === "2") {
|
||||||
body.username = values.username;
|
body.username = values.username;
|
||||||
|
body.language = i18n.language;
|
||||||
}
|
}
|
||||||
|
|
||||||
myFetch({
|
myFetch({
|
||||||
|
|
|
@ -201,7 +201,7 @@ function ModalAddEditEmployee({
|
||||||
setModalOptions,
|
setModalOptions,
|
||||||
fetchEmployees,
|
fetchEmployees,
|
||||||
}) {
|
}) {
|
||||||
const { t } = useTranslation();
|
const { t, i18n } = useTranslation();
|
||||||
const [notificationApi, notificationContextHolder] =
|
const [notificationApi, notificationContextHolder] =
|
||||||
notification.useNotification();
|
notification.useNotification();
|
||||||
const { storeId } = useParams();
|
const { storeId } = useParams();
|
||||||
|
@ -283,6 +283,7 @@ function ModalAddEditEmployee({
|
||||||
username: values.username,
|
username: values.username,
|
||||||
accountName: values.accountName,
|
accountName: values.accountName,
|
||||||
password: EncodeStringToBase64(values.password),
|
password: EncodeStringToBase64(values.password),
|
||||||
|
language: i18n.language,
|
||||||
};
|
};
|
||||||
|
|
||||||
if (
|
if (
|
||||||
|
|
Loading…
Reference in New Issue