diff --git a/src/components/FiDataGrid.js b/src/components/FiDataGrid.js index 761b5ec..f8a89bc 100644 --- a/src/components/FiDataGrid.js +++ b/src/components/FiDataGrid.js @@ -4,7 +4,7 @@ import { DataGrid, GridOverlay, } from "@mui/x-data-grid"; import {FormattedMessage, useIntl} from "react-intl"; -import {Typography} from '@mui/material'; +import {TablePagination, Typography} from '@mui/material'; // ==============================|| EVENT TABLE ||============================== // @@ -124,27 +124,12 @@ export function FiDataGrid({ rows, columns, sx, autoHeight, return ( - + ); } - const CustomPagination = (props) => { - const { pagination } = props; - const { page, pageSize, rowCount } = pagination; - - const startIndex = page * pageSize + 1; - const endIndex = Math.min((page + 1) * pageSize, rowCount); - - return ( -
-
{`${startIndex}-${endIndex} YES ${rowCount}`}
- {/* Render other pagination controls */} -
- ); - }; - return ( ( + { + return '' + from + '-' + to + ' 123 ' + count + } + } + /> + ), }} componentsProps={{ pagination: { - labelRowsPerPage: intl.formatMessage({id: 'rowsPerPage'}), + labelRowsPerPage: intl.formatMessage({id: 'rowsPerPage'}) + ":", } }} /> diff --git a/src/pages/authentication/auth-forms/AuthLogin.js b/src/pages/authentication/auth-forms/AuthLogin.js index 9e962fe..4eb1de5 100644 --- a/src/pages/authentication/auth-forms/AuthLogin.js +++ b/src/pages/authentication/auth-forms/AuthLogin.js @@ -1,4 +1,4 @@ -import React, {useEffect, useState} from 'react'; +import React, {useContext, useEffect, useState} from 'react'; import {useNavigate} from 'react-router-dom'; // material-ui @@ -36,6 +36,7 @@ import {useDispatch} from "react-redux"; import {handleLogin} from "auth/index"; import { notifyActionSuccess } from 'utils/CommonFunction'; import {FormattedMessage} from "react-intl"; +import LocaleContext from "../../../components/I18nProvider"; // ============================|| FIREBASE - LOGIN ||============================ // const AuthLogin = () => { @@ -69,6 +70,7 @@ const AuthLogin = () => { }) .then((response) => { //setPosts("12354") + console.log(response.data); setPosts(response.data); const userData = { id: response.data.id, diff --git a/src/pages/authentication/auth-forms/AuthLoginCustom.js b/src/pages/authentication/auth-forms/AuthLoginCustom.js index 0784c6a..59f85f8 100644 --- a/src/pages/authentication/auth-forms/AuthLoginCustom.js +++ b/src/pages/authentication/auth-forms/AuthLoginCustom.js @@ -1,7 +1,7 @@ import React, { useEffect, useState, - lazy + lazy, useContext } from 'react'; import { Link as RouterLink } from 'react-router-dom'; import { useNavigate } from 'react-router-dom'; @@ -45,12 +45,14 @@ import { handleLogin } from "auth/index"; import useJwt from "../../../auth/jwt/useJwt"; import { handleLogoutFunction } from 'auth/index'; import {FormattedMessage, useIntl} from "react-intl"; +import LocaleContext from "../../../components/I18nProvider"; // ============================|| FIREBASE - LOGIN ||============================ // const AuthLoginCustom = () => { const dispatch = useDispatch() const navigate = useNavigate() const intl = useIntl(); + const { setLocale } = useContext(LocaleContext); const [showPassword, setShowPassword] = useState(false); const handleClickShowPassword = () => { @@ -88,6 +90,11 @@ const AuthLoginCustom = () => { } const data = { ...userData, accessToken: response.data.accessToken, refreshToken: response.data.refreshToken } // setSuccess(true) + console.log(response.data.role); + if(response.data.type === "GLD"){ + setLocale("en"); + localStorage.setItem('locale','en'); + } dispatch(handleLogin(data)) navigate('/dashboard'); location.reload()