Refactor project for improved localization and user experience: Renamed project to "reactshop" and updated package-lock.json with new dependencies. Enhanced profile navigation by updating the ButtonGroup component to navigate to the cart section. Improved German translation files with additional phrases for better context and clarity. Updated CartTab component to utilize the latest i18n functionality.
This commit is contained in:
@@ -9,6 +9,7 @@ import {
|
||||
CircularProgress
|
||||
} from '@mui/material';
|
||||
import { useLocation, useNavigate, Navigate } from 'react-router-dom';
|
||||
import { useTranslation } from 'react-i18next';
|
||||
import SocketContext from '../contexts/SocketContext.js';
|
||||
|
||||
// Import extracted components
|
||||
@@ -21,6 +22,7 @@ import LoginComponent from '../components/LoginComponent.js';
|
||||
const ProfilePage = (props) => {
|
||||
const location = useLocation();
|
||||
const navigate = useNavigate();
|
||||
const { t } = useTranslation();
|
||||
const [tabValue, setTabValue] = useState(0);
|
||||
const [user, setUser] = useState(null);
|
||||
const [loading, setLoading] = useState(true);
|
||||
@@ -208,10 +210,10 @@ const ProfilePage = (props) => {
|
||||
<Box sx={{ bgcolor: '#2e7d32', p: { xs: 2, sm: 3 }, color: 'white' }}>
|
||||
<Typography variant="h5" fontWeight="bold">
|
||||
{window.innerWidth < 600 ?
|
||||
(tabValue === 0 ? 'Bestellabschluss' :
|
||||
tabValue === 1 ? 'Bestellungen' :
|
||||
tabValue === 2 ? 'Einstellungen' : 'Mein Profil')
|
||||
: 'Mein Profil'
|
||||
(tabValue === 0 ? (t ? t('auth.menu.checkout') : 'Bestellabschluss') :
|
||||
tabValue === 1 ? (t ? t('auth.menu.orders') : 'Bestellungen') :
|
||||
tabValue === 2 ? (t ? t('auth.menu.settings') : 'Einstellungen') : (t ? t('auth.profile') : 'Mein Profil'))
|
||||
: (t ? t('auth.profile') : 'Mein Profil')
|
||||
}
|
||||
</Typography>
|
||||
{user && (
|
||||
@@ -236,21 +238,21 @@ const ProfilePage = (props) => {
|
||||
}}
|
||||
>
|
||||
<Tab
|
||||
label="Bestellabschluss"
|
||||
label={t ? t('auth.menu.checkout') : 'Bestellabschluss'}
|
||||
sx={{
|
||||
color: tabValue === 0 ? '#2e7d32' : 'inherit',
|
||||
fontWeight: 'bold'
|
||||
}}
|
||||
/>
|
||||
<Tab
|
||||
label="Bestellungen"
|
||||
label={t ? t('auth.menu.orders') : 'Bestellungen'}
|
||||
sx={{
|
||||
color: tabValue === 1 ? '#2e7d32' : 'inherit',
|
||||
fontWeight: 'bold'
|
||||
}}
|
||||
/>
|
||||
<Tab
|
||||
label="Einstellungen"
|
||||
label={t ? t('auth.menu.settings') : 'Einstellungen'}
|
||||
sx={{
|
||||
color: tabValue === 2 ? '#2e7d32' : 'inherit',
|
||||
fontWeight: 'bold'
|
||||
|
||||
Reference in New Issue
Block a user