feat: implement kiosk mode functionality and update UI elements accordingly
This commit is contained in:
@@ -291,8 +291,22 @@ const MainPageLayout = () => {
|
||||
const currentPath = location.pathname;
|
||||
const { t } = useTranslation();
|
||||
const [starHovered, setStarHovered] = React.useState(false);
|
||||
|
||||
// State to track kiosk mode
|
||||
const [isKiosk, setIsKiosk] = React.useState(() => window.growheadskiosk === true);
|
||||
|
||||
// Listen for the custom event
|
||||
React.useEffect(() => {
|
||||
const handleKioskChange = () => {
|
||||
setIsKiosk(window.growheadskiosk === true);
|
||||
};
|
||||
|
||||
window.addEventListener('growheadskiosk-change', handleKioskChange);
|
||||
return () => window.removeEventListener('growheadskiosk-change', handleKioskChange);
|
||||
}, []);
|
||||
|
||||
const translatedContent = {
|
||||
buildYourSet: t('sections.buildYourSet'),
|
||||
buildYourSet: isKiosk ? 'Schau in den Stecklingskatalog' : t('sections.buildYourSet'),
|
||||
selectSeedRate: t('sections.selectSeedRate'),
|
||||
outdoorSeason: t('sections.outdoorSeason')
|
||||
};
|
||||
@@ -317,7 +331,7 @@ const MainPageLayout = () => {
|
||||
const allContentBoxes = {
|
||||
home: [
|
||||
{ title: t('sections.seeds'), image: "/assets/images/seeds.avif", bgcolor: "#e1f0d3", link: "/Kategorie/Seeds" },
|
||||
{ title: t('sections.konfigurator'), image: "/assets/images/konfigurator.avif", bgcolor: "#e8f5d6", link: "/Konfigurator" }
|
||||
{ title: isKiosk ? 'Stecklingskatalog' : t('sections.konfigurator'), image: isKiosk ? "/assets/images/cutlings2.avif" : "/assets/images/konfigurator.avif", bgcolor: "#e8f5d6", link: isKiosk ? "https://cloneheads.de" : "/Konfigurator" }
|
||||
],
|
||||
aktionen: [
|
||||
{ title: t('sections.oilPress'), image: "/assets/images/presse.jpg", bgcolor: "#e1f0d3", link: "/Artikel/Graveda-10t-presse-tagesmiete-inkl-prepress-vorpressform" },
|
||||
|
||||
Reference in New Issue
Block a user