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:
sebseb7
2025-07-16 08:14:16 +02:00
parent 13f1e14a3d
commit f8dbb24823
5 changed files with 12343 additions and 19 deletions

12326
package-lock.json generated

File diff suppressed because it is too large Load Diff

View File

@@ -175,7 +175,7 @@ class ButtonGroup extends Component {
if (isUserLoggedIn().isLoggedIn) { if (isUserLoggedIn().isLoggedIn) {
this.toggleCart(); // Close the cart drawer this.toggleCart(); // Close the cart drawer
navigate('/profile'); navigate('/profile#cart');
} else if (window.openLoginDrawer) { } else if (window.openLoginDrawer) {
window.openLoginDrawer(); // Call global function to open login drawer window.openLoginDrawer(); // Call global function to open login drawer
this.toggleCart(); // Close the cart drawer this.toggleCart(); // Close the cart drawer

View File

@@ -542,4 +542,4 @@ class CartTab extends Component {
// Set static contextType to access the socket // Set static contextType to access the socket
CartTab.contextType = SocketContext; CartTab.contextType = SocketContext;
export default withI18n(CartTab); export default withI18n()(CartTab);

View File

@@ -28,6 +28,7 @@ export default {
"newPasswordMinLength": "Das neue Passwort muss mindestens 8 Zeichen lang sein", "newPasswordMinLength": "Das neue Passwort muss mindestens 8 Zeichen lang sein",
"menu": { "menu": {
"profile": "Profil", "profile": "Profil",
"myProfile": "Mein Profil",
"checkout": "Bestellabschluss", "checkout": "Bestellabschluss",
"orders": "Bestellungen", "orders": "Bestellungen",
"settings": "Einstellungen", "settings": "Einstellungen",
@@ -43,6 +44,8 @@ export default {
"continueShopping": "Weiter einkaufen", "continueShopping": "Weiter einkaufen",
"proceedToCheckout": "Weiter zur Kasse", "proceedToCheckout": "Weiter zur Kasse",
"productCount": "{{count}} {{count, plural, one {Produkt} other {Produkte}}}", "productCount": "{{count}} {{count, plural, one {Produkt} other {Produkte}}}",
"productSingular": "Produkt",
"productPlural": "Produkte",
"removeFromCart": "Aus dem Warenkorb entfernen", "removeFromCart": "Aus dem Warenkorb entfernen",
"openCart": "Warenkorb öffnen", "openCart": "Warenkorb öffnen",
"availableFrom": "Ab {{date}}", "availableFrom": "Ab {{date}}",
@@ -81,7 +84,8 @@ export default {
"oneProduct": "1 Produkt", "oneProduct": "1 Produkt",
"multipleProducts": "{{count}} Produkte", "multipleProducts": "{{count}} Produkte",
"filteredProducts": "{{filtered}} von {{total}} Produkten", "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", "removeFiltersToSee": "Entferne Filter um Produkte zu sehen",
"outOfStock": "Out of Stock", "outOfStock": "Out of Stock",
@@ -112,7 +116,8 @@ export default {
"standard": "Standardversand", "standard": "Standardversand",
"standardFree": "Standardversand - KOSTENLOS ab 100€ Warenwert!", "standardFree": "Standardversand - KOSTENLOS ab 100€ Warenwert!",
"notAvailable": "nicht auswählbar weil ein oder mehrere Artikel nur abgeholt werden können", "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": { "prices": {
"free": "kostenlos", "free": "kostenlos",
@@ -148,7 +153,8 @@ export default {
"sorting": "Sortierung", "sorting": "Sortierung",
"perPage": "pro Seite", "perPage": "pro Seite",
"availability": "Verfügbarkeit", "availability": "Verfügbarkeit",
"manufacturer": "Hersteller" "manufacturer": "Hersteller",
"all": "Alle"
}, },
"tax": { "tax": {
"vat": "Mehrwertsteuer", "vat": "Mehrwertsteuer",
@@ -157,7 +163,9 @@ export default {
"vat19WithShipping": "19% Mehrwertsteuer (inkl. Versand)", "vat19WithShipping": "19% Mehrwertsteuer (inkl. Versand)",
"totalNet": "Gesamtnettopreis", "totalNet": "Gesamtnettopreis",
"totalGross": "Gesamtbruttopreis ohne Versand", "totalGross": "Gesamtbruttopreis ohne Versand",
"subtotal": "Zwischensumme" "subtotal": "Zwischensumme",
"incl7Vat": "inkl. 7% MwSt.",
"inclVatWithFooter": "(incl. {{vat}}% USt.,*)"
}, },
"footer": { "footer": {
"hours": "Sa 11-19", "hours": "Sa 11-19",

View File

@@ -9,6 +9,7 @@ import {
CircularProgress CircularProgress
} from '@mui/material'; } from '@mui/material';
import { useLocation, useNavigate, Navigate } from 'react-router-dom'; import { useLocation, useNavigate, Navigate } from 'react-router-dom';
import { useTranslation } from 'react-i18next';
import SocketContext from '../contexts/SocketContext.js'; import SocketContext from '../contexts/SocketContext.js';
// Import extracted components // Import extracted components
@@ -21,6 +22,7 @@ import LoginComponent from '../components/LoginComponent.js';
const ProfilePage = (props) => { const ProfilePage = (props) => {
const location = useLocation(); const location = useLocation();
const navigate = useNavigate(); const navigate = useNavigate();
const { t } = useTranslation();
const [tabValue, setTabValue] = useState(0); const [tabValue, setTabValue] = useState(0);
const [user, setUser] = useState(null); const [user, setUser] = useState(null);
const [loading, setLoading] = useState(true); const [loading, setLoading] = useState(true);
@@ -208,10 +210,10 @@ const ProfilePage = (props) => {
<Box sx={{ bgcolor: '#2e7d32', p: { xs: 2, sm: 3 }, color: 'white' }}> <Box sx={{ bgcolor: '#2e7d32', p: { xs: 2, sm: 3 }, color: 'white' }}>
<Typography variant="h5" fontWeight="bold"> <Typography variant="h5" fontWeight="bold">
{window.innerWidth < 600 ? {window.innerWidth < 600 ?
(tabValue === 0 ? 'Bestellabschluss' : (tabValue === 0 ? (t ? t('auth.menu.checkout') : 'Bestellabschluss') :
tabValue === 1 ? 'Bestellungen' : tabValue === 1 ? (t ? t('auth.menu.orders') : 'Bestellungen') :
tabValue === 2 ? 'Einstellungen' : 'Mein Profil') tabValue === 2 ? (t ? t('auth.menu.settings') : 'Einstellungen') : (t ? t('auth.profile') : 'Mein Profil'))
: 'Mein Profil' : (t ? t('auth.profile') : 'Mein Profil')
} }
</Typography> </Typography>
{user && ( {user && (
@@ -236,21 +238,21 @@ const ProfilePage = (props) => {
}} }}
> >
<Tab <Tab
label="Bestellabschluss" label={t ? t('auth.menu.checkout') : 'Bestellabschluss'}
sx={{ sx={{
color: tabValue === 0 ? '#2e7d32' : 'inherit', color: tabValue === 0 ? '#2e7d32' : 'inherit',
fontWeight: 'bold' fontWeight: 'bold'
}} }}
/> />
<Tab <Tab
label="Bestellungen" label={t ? t('auth.menu.orders') : 'Bestellungen'}
sx={{ sx={{
color: tabValue === 1 ? '#2e7d32' : 'inherit', color: tabValue === 1 ? '#2e7d32' : 'inherit',
fontWeight: 'bold' fontWeight: 'bold'
}} }}
/> />
<Tab <Tab
label="Einstellungen" label={t ? t('auth.menu.settings') : 'Einstellungen'}
sx={{ sx={{
color: tabValue === 2 ? '#2e7d32' : 'inherit', color: tabValue === 2 ? '#2e7d32' : 'inherit',
fontWeight: 'bold' fontWeight: 'bold'