Skip to content

Commit

Permalink
Merge branch 'dev' into uat
Browse files Browse the repository at this point in the history
# Conflicts:
#	src/index.js
#	src/utils/globals.js
#	src/views/Start/Header.js
#	src/views/Start/Start.js
  • Loading branch information
martinheppner committed Sep 7, 2024
2 parents 5dc77c9 + fe80471 commit 8841032
Show file tree
Hide file tree
Showing 49 changed files with 5,897 additions and 537 deletions.
Binary file removed public/img/background_start_tiny_at.jpeg
Binary file not shown.
Binary file removed public/img/background_start_tiny_ch.jpeg
Binary file not shown.
Binary file removed public/img/background_start_tiny_de.jpeg
Binary file not shown.
Binary file removed public/img/background_start_tiny_fr.jpeg
Binary file not shown.
Binary file removed public/img/background_start_tiny_it.jpeg
Binary file not shown.
Binary file removed public/img/background_start_tiny_li.jpeg
Binary file not shown.
Binary file removed public/img/background_start_tiny_si.jpeg
Binary file not shown.
30 changes: 0 additions & 30 deletions public/index.html
Original file line number Diff line number Diff line change
@@ -1,15 +1,6 @@
<!DOCTYPE html>
<html lang="de" id="html-tag">
<head>
<link rel="alternate" href="https://www.zuugle.si" hreflang="sl-si" />
<link rel="canonical" href="https://www.zuugle.at" hreflang="de-at" />
<link rel="alternate" href="https://www.zuugle.de" hreflang="de-de" />
<link rel="alternate" href="https://www.zuugle.it" hreflang="it-it" />
<link rel="alternate" href="https://www.zuugle.ch" hreflang="de-ch" />
<link rel="alternate" href="https://www.zuugle.li" hreflang="de-li" />
<link rel="alternate" href="https://www.zuugle.fr" hreflang="fr-fr" />
<link rel="preconnect" href="https://www.bahn-zum-berg.at" />

<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<meta name="theme-color" content="#000000" />
Expand All @@ -21,31 +12,10 @@
<meta name="robots" content="index, follow"/>

<!-- Primary Meta Tags -> now using react helmet -->

<!-- Open Graph / Facebook -->
<meta property="og:type" content="website">
<meta property="og:url" content="https://www.zuugle.at/">
<meta property="og:title" content="Zuugle - die Suchmaschine für Öffi-Bergtouren im österreichischen Alpenraum">
<meta
property="og:description"
content="Zuugle zeigt dir geprüfte Verbindungen mit Bahn und Bus zu Bergtouren, Wanderungen, Skitouren, Schneeschuhwanderungen, etc. von deinem Wohnort aus an.">
<meta property="og:image" content="https://www.zuugle.at/app_static/img/Zuugle_Opengraph.jpg">

<!-- Twitter -->
<meta property="twitter:card" content="summary_large_image">
<meta property="twitter:url" content="https://www.zuugle.at/">
<meta property="twitter:title" content="Zuugle - die Suchmaschine für Öffi-Bergtouren im österreichischen Alpenraum">

<meta
property="twitter:description"
content="Zuugle zeigt dir geprüfte Verbindungen mit Bahn und Bus zu Bergtouren, Wanderungen, Skitouren, Schneeschuhwanderungen, etc. von deinem Wohnort aus an.">
<meta property="twitter:image" content="https://www.zuugle.at/app_static/img/Zuugle_Opengraph.jpg">
</head>

<body>
<noscript>Es scheint, dass du Javascript nicht aktiviert hast. Diese Suchmaschine für Öffi-Bergtouren benötigt aber Javascript um zu funktionieren. Bitte aktiviere Javacript in deinem Browser.</noscript>

<div id="root"></div>

</body>
</html>
8 changes: 8 additions & 0 deletions src/App.css
Original file line number Diff line number Diff line change
Expand Up @@ -1859,3 +1859,11 @@ top:250px; */


}

.disabled-button {
background-color: #e0e0e0 !important;
color: #9e9e9e !important;
cursor: not-allowed;
pointer-events: none;
box-shadow: none;
}
174 changes: 76 additions & 98 deletions src/App.js
Original file line number Diff line number Diff line change
@@ -1,119 +1,97 @@
import CircularProgress from "@mui/material/CircularProgress";
import ThemeProvider from "@mui/material/styles/ThemeProvider";
import * as React from "react";
import { lazy, Suspense } from "react";
import { Navigate, Route, Routes } from "react-router-dom";
import "./App.css";
import ModalRoot from "./components/ModalRoot";
import ThemeProvider from "@mui/material/styles/ThemeProvider";
import { theme } from "./theme";
import Start from "./views/Start/Start";
import ModalRoot from "./components/ModalRoot";
import { Route, Routes, Navigate } from "react-router-dom";
import { lazy, Suspense, useCallback } from "react";
import CircularProgress from "@mui/material/CircularProgress";
// import Start from "./views/Start/Start";
// import DetailReworked from "./views/Main/DetailReworked";
// import Search from "./components/Search/Search";
import i18next from "i18next";
import { getTopLevelDomain } from "./utils/globals";
import "/src/config.js";
import '/src/config.js';

const Main = lazy(() => import("./views/Main/Main"));
const Impressum = lazy(() => import("./views/Pages/Impressum"));
const Privacy = lazy(() => import("./views/Pages/Privacy"));
const DetailReworked = lazy(() => import("./views/Main/DetailReworked"));
const Search = lazy(() => import("./components/Search/Search"));
// const Start = lazy(() => import("./views/Start/Start"));
const DetailReworked = lazy(() => import("./views/Main/DetailReworked"));
const Search = lazy(() => import("./components/Search/Search"));
const Start = lazy(() => import("./views/Start/Start"));




function App() {
//check if first visit and change code to domain language
if (!localStorage.getItem("visited")) {
let domain = getTopLevelDomain();
//check if first visit and change code to domain language
if(!localStorage.getItem('visited')) {

let domain = getTopLevelDomain();

//switch to domain language
switch (domain) {
case 'si':
i18next.changeLanguage('sl');
break;
case 'fr':
i18next.changeLanguage('fr');
break;
case 'it':
i18next.changeLanguage('it');
break;
default:
i18next.changeLanguage('de');
break;
}

localStorage.setItem('visited',true);
}

// Matomo tracking
var _mtm = window._mtm = window._mtm || [];
React.useEffect(() => {
_mtm.push({'mtm.startTime': (new Date().getTime()), 'event': 'mtm.Start'});
var d=document, g=d.createElement('script'), s=d.getElementsByTagName('script')[0];
g.async=true; g.src='https://stats.bahnzumberg.at/js/container_ANAXmMKf.js'; s.parentNode.insertBefore(g,s);
let language = i18next.resolvedLanguage;
_mtm.push({'language': language});
});

//switch to domain language
switch (domain) {
case "si":
i18next.changeLanguage("sl");
break;
case "fr":
i18next.changeLanguage("fr");
break;
case "it":
i18next.changeLanguage("it");
break;
default:
i18next.changeLanguage("de");
break;
}

localStorage.setItem("visited", true);
}

// Matomo tracking
var _mtm = (window._mtm = window._mtm || []);
React.useEffect(() => {
_mtm.push({
"mtm.startTime": new Date().getTime(),
event: "mtm.Start",
});
var d = document,
g = d.createElement("script"),
s = d.getElementsByTagName("script")[0];
g.async = true;
g.src = "https://stats.bahnzumberg.at/js/container_ANAXmMKf.js";
s.parentNode.insertBefore(g, s);
let language = i18next.resolvedLanguage;
_mtm.push({ language: language });
}, []);
return (
<>
<ThemeProvider theme={theme}>
<div className="App" style={{ minHeight: '100vh', display: 'flex', flexDirection: 'column' }}>
<Suspense
fallback={
<div style={{ height: "100%", width: "100%", padding: "20px" }}>
<CircularProgress />
</div>
}
>
<Routes>
<Route path="/" element={<Start />} />
<Route path="/total" element={<Start />} />
<Route path="/search" element={<Main />} />
<Route path="/tour/:idOne/:cityOne" element={<DetailReworked />} />
<Route path="/tour" element={<DetailReworked />} />
<Route path="/provider/:provider" element={<DetailReworked />} />
<Route path="/imprint" element={<Impressum />} />
<Route path="/privacy" element={<Privacy />} />
<Route path="/:city" element={<Main />} />
<Route path="/searchPhrases" element={<Search />} />

return (
<>
<ThemeProvider theme={theme}>
<div
className="App"
style={{
minHeight: "100vh",
display: "flex",
flexDirection: "column",
}}
>
<Suspense
fallback={
<div
style={{
height: "100%",
width: "100%",
padding: "20px",
}}
>
<CircularProgress />
</div>
}
>
<Routes>
<Route path="/" element={<Start />} />
<Route path="/total" element={<Start />} />
<Route path="/search" element={<Main />} />
<Route
path="/tour/:idOne/:cityOne"
element={<DetailReworked />}
/>
<Route path="/tour" element={<DetailReworked />} />
<Route
path="/provider/:provider"
element={<DetailReworked />}
/>
<Route path="/imprint" element={<Impressum />} />
<Route path="/privacy" element={<Privacy />} />
<Route path="/:city" element={<Main />} />
<Route path="/searchPhrases" element={<Search />} />
<Route path="*" element={<Navigate to="/" replace />} />
</Routes>
</Suspense>
</div>
<ModalRoot />
</ThemeProvider>
</>

<Route
path="*"
element={<Navigate to="/" replace />}
/>
</Routes>
</Suspense>
</div>
<ModalRoot />
</ThemeProvider>
</>
);
);
}

export default App;
27 changes: 22 additions & 5 deletions src/components/Filter/Filter.js
Original file line number Diff line number Diff line change
Expand Up @@ -287,14 +287,20 @@ function Filter({filter, doSubmit, resetFilter, searchParams, loadFilter, isLoad
}
}



const submit = () => {
let swLat = !!coordinatesSouthWest?.lat && (coordinatesSouthWest?.lat).toFixed(6);
let swLng = !!coordinatesSouthWest?.lng && (coordinatesSouthWest?.lng).toFixed(6);
let neLat = !!coordinatesNorthEast?.lat && (coordinatesNorthEast?.lat).toFixed(6);
let neLng = !!coordinatesNorthEast?.lng && (coordinatesNorthEast?.lng).toFixed(6);

const filterValues = {
//coordinates: coordinates, //Füg den Wert in die URL ein
coordinatesSouthWest: coordinatesSouthWest,
coordinatesNorthEast: coordinatesNorthEast,
// s: !!coordinatesSouthWest?.lat && (coordinatesSouthWest?.lat).toFixed(6),
s: swLat,
w: swLng,
n: neLat,
e: neLng,
singleDayTour: mapPosNegValues(singleDayTour),
multipleDayTour: mapPosNegValues(multipleDayTour),
summerSeason: mapPosNegValues(summerSeason),
Expand All @@ -315,7 +321,7 @@ function Filter({filter, doSubmit, resetFilter, searchParams, loadFilter, isLoad
}
localStorage.setItem("filterValues", JSON.stringify(filterValues));
localStorage.setItem("filterCount", countFilterActive());
doSubmit({filterValues: filterValues, filterCount: countFilterActive()});
countFilterActive() > 0 && doSubmit({filterValues: filterValues, filterCount: countFilterActive()});
}

const checkIfCheckedFromCheckbox = (list, key) => {
Expand Down Expand Up @@ -712,11 +718,22 @@ function Filter({filter, doSubmit, resetFilter, searchParams, loadFilter, isLoad
justifyContent: { xs: "center", sm: "end" }
}}>
<Box sx={{ pt: "18px" }}>
<Button variant={"text"} sx={{ marginRight: "15px", color: "#8B8B8B" }} onClick={resetFilter}> {filter_loeschen_label}</Button>
<Button variant={"text"} sx={{ marginRight: "15px", color: "#8B8B8B" }}
onClick={resetFilter}> {filter_loeschen_label}
</Button>
<Button variant={"contained"} onClick={submit} >
{countFilterActive() === 0 ? '' : countFilterActive()}
{" "}{filter_anwenden_label}
</Button>
{/* <Button
variant={"contained"}
onClick={submit}
disabled={countFilterActive() === 0}
className={countFilterActive() === 0 ? 'disabled-button' : ''}
>
{countFilterActive() === 0 ? '' : countFilterActive()}
{" "}{filter_anwenden_label}
</Button> */}
</Box>
</Box>
</Fragment>
Expand Down
4 changes: 3 additions & 1 deletion src/components/InteractiveMap.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import * as React from 'react';
import {useRef, useEffect, useMemo} from 'react';
import { MapContainer, TileLayer, Marker, Polyline, useMap } from 'react-leaflet';
import { MapContainer, TileLayer, Marker, Polyline, useMap, ZoomControl } from 'react-leaflet';
import 'leaflet/dist/leaflet.css';
import L, { divIcon } from 'leaflet';

Expand Down Expand Up @@ -81,6 +81,7 @@ useEffect(() => {
center={[47.800499, 13.04441]}
zoom={12}
style={{ height: "100%", width: "100%" }}
zoomControl={false}
// whenCreated={(mapInstance)=> { mapRef.current = mapInstance }}
>
<TileLayer url="https://opentopo.bahnzumberg.at/{z}/{x}/{y}.png.webp" />
Expand Down Expand Up @@ -108,6 +109,7 @@ useEffect(() => {
positions={abreiseGpxPositions}
/>
)}
<ZoomControl position="bottomright" />
</MapContainer>
)
}
Loading

0 comments on commit 8841032

Please sign in to comment.