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:
12326
package-lock.json
generated
12326
package-lock.json
generated
File diff suppressed because it is too large
Load Diff
@@ -175,7 +175,7 @@ class ButtonGroup extends Component {
|
||||
|
||||
if (isUserLoggedIn().isLoggedIn) {
|
||||
this.toggleCart(); // Close the cart drawer
|
||||
navigate('/profile');
|
||||
navigate('/profile#cart');
|
||||
} else if (window.openLoginDrawer) {
|
||||
window.openLoginDrawer(); // Call global function to open login drawer
|
||||
this.toggleCart(); // Close the cart drawer
|
||||
|
||||
@@ -542,4 +542,4 @@ class CartTab extends Component {
|
||||
// Set static contextType to access the socket
|
||||
CartTab.contextType = SocketContext;
|
||||
|
||||
export default withI18n(CartTab);
|
||||
export default withI18n()(CartTab);
|
||||
|
||||
@@ -28,6 +28,7 @@ export default {
|
||||
"newPasswordMinLength": "Das neue Passwort muss mindestens 8 Zeichen lang sein",
|
||||
"menu": {
|
||||
"profile": "Profil",
|
||||
"myProfile": "Mein Profil",
|
||||
"checkout": "Bestellabschluss",
|
||||
"orders": "Bestellungen",
|
||||
"settings": "Einstellungen",
|
||||
@@ -43,6 +44,8 @@ export default {
|
||||
"continueShopping": "Weiter einkaufen",
|
||||
"proceedToCheckout": "Weiter zur Kasse",
|
||||
"productCount": "{{count}} {{count, plural, one {Produkt} other {Produkte}}}",
|
||||
"productSingular": "Produkt",
|
||||
"productPlural": "Produkte",
|
||||
"removeFromCart": "Aus dem Warenkorb entfernen",
|
||||
"openCart": "Warenkorb öffnen",
|
||||
"availableFrom": "Ab {{date}}",
|
||||
@@ -81,7 +84,8 @@ export default {
|
||||
"oneProduct": "1 Produkt",
|
||||
"multipleProducts": "{{count}} Produkte",
|
||||
"filteredProducts": "{{filtered}} von {{total}} Produkten",
|
||||
"filteredOneProduct": "{{filtered}} von 1 Produkt"
|
||||
"filteredOneProduct": "{{filtered}} von 1 Produkt",
|
||||
"xOfYProducts": "{{x}} von {{y}} Produkten"
|
||||
},
|
||||
"removeFiltersToSee": "Entferne Filter um Produkte zu sehen",
|
||||
"outOfStock": "Out of Stock",
|
||||
@@ -112,7 +116,8 @@ export default {
|
||||
"standard": "Standardversand",
|
||||
"standardFree": "Standardversand - KOSTENLOS ab 100€ Warenwert!",
|
||||
"notAvailable": "nicht auswählbar weil ein oder mehrere Artikel nur abgeholt werden können",
|
||||
"bulky": "Für große und schwere Artikel"
|
||||
"bulky": "Für große und schwere Artikel",
|
||||
"pickupOnly": "nur Abholung"
|
||||
},
|
||||
"prices": {
|
||||
"free": "kostenlos",
|
||||
@@ -148,7 +153,8 @@ export default {
|
||||
"sorting": "Sortierung",
|
||||
"perPage": "pro Seite",
|
||||
"availability": "Verfügbarkeit",
|
||||
"manufacturer": "Hersteller"
|
||||
"manufacturer": "Hersteller",
|
||||
"all": "Alle"
|
||||
},
|
||||
"tax": {
|
||||
"vat": "Mehrwertsteuer",
|
||||
@@ -157,7 +163,9 @@ export default {
|
||||
"vat19WithShipping": "19% Mehrwertsteuer (inkl. Versand)",
|
||||
"totalNet": "Gesamtnettopreis",
|
||||
"totalGross": "Gesamtbruttopreis ohne Versand",
|
||||
"subtotal": "Zwischensumme"
|
||||
"subtotal": "Zwischensumme",
|
||||
"incl7Vat": "inkl. 7% MwSt.",
|
||||
"inclVatWithFooter": "(incl. {{vat}}% USt.,*)"
|
||||
},
|
||||
"footer": {
|
||||
"hours": "Sa 11-19",
|
||||
|
||||
@@ -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