Skip to content

Commit

Permalink
When provider = bahnzumberg the open link to bzb directly
Browse files Browse the repository at this point in the history
  • Loading branch information
martinheppner committed Dec 11, 2024
1 parent af5b3cf commit d5227f5
Show file tree
Hide file tree
Showing 5 changed files with 31 additions and 7 deletions.
9 changes: 8 additions & 1 deletion src/components/Map/PopupCard.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,15 @@ export default function PopupCard({tour, city}){

if(searchParams.get('filter')) searchParams.delete("filter");
if(searchParams.get('map')) searchParams.delete("map");
let provider = searchParams.get("p");

let tourLink = `/tour/${tour.id}/${city}`;
let tourLink = ``;
if (provider == 'bahnzumberg') {
tourLink = `${tour.url}ab-${city}/`;
}
else {
tourLink = `/tour/${tour.id}/${city}`;
}

// i18next
const {t} = useTranslation();
Expand Down
7 changes: 5 additions & 2 deletions src/components/ScrollingTourCardContainer.js
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,7 @@ export default function ScrollingTourCardContainer({
city,
isLoading,
isMobile,
provider,
}) {
const { t } = useTranslation();
const firstSet = tours.slice(0, 4);
Expand Down Expand Up @@ -96,6 +97,7 @@ export default function ScrollingTourCardContainer({
tour={tour}
onSelectTour={onSelectTour}
city={city}
provider={provider}
/>
))}
{renderImage("/app_static/img/zuugle-ad.gif", "image1")}
Expand All @@ -105,6 +107,7 @@ export default function ScrollingTourCardContainer({
tour={tour}
onSelectTour={onSelectTour}
city={city}
provider={provider}
/>
))}
{renderFourth(t)}
Expand All @@ -114,14 +117,14 @@ export default function ScrollingTourCardContainer({
);
}

function Card({ tour, onSelectTour, city }) {
function Card({ tour, onSelectTour, city, provider }) {
return (
<Box
className={"react-horizontal-scrolling-card"}
tabIndex={0}
component="div"
>
<TourCard onSelectTour={onSelectTour} tour={tour} city={city} />
<TourCard onSelectTour={onSelectTour} tour={tour} city={city} provider={provider}/>
</Box>
);
}
15 changes: 13 additions & 2 deletions src/components/TourCard.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ export default function TourCard({
tour,
onSelectTour,
city,
provider
}) {
const [image, setImage] = useState(DEFAULT_IMAGE);
const imageOpacity = 1;
Expand All @@ -24,10 +25,20 @@ export default function TourCard({
// let tourLink = `/tour?id=${tour.id}&city=${city}`;
let tourLink=``
if (!!city && city != null && city !=='no-city'){
tourLink = `/tour/${tour.id}/${city}`;
if (provider == 'bahnzumberg') {
tourLink = `${tour.url}ab-${city}/`;
}
else {
tourLink = `/tour/${tour.id}/${city}`;
}
}
else {
tourLink = `/tour/${tour.id}/no-city`
if (provider == 'bahnzumberg') {
tourLink = `${tour.url}`;
}
else {
tourLink = `/tour/${tour.id}/no-city`
}
}

// i18next
Expand Down
6 changes: 4 additions & 2 deletions src/components/TourCardContainer.js
Original file line number Diff line number Diff line change
Expand Up @@ -94,10 +94,11 @@ export default function TourCardContainer({
provider: provider,
page: !!pageTours ? Number(pageTours) + 1 : 2,
bounds: bounds, // bounds added
}).then((res) => {
});
// .then((res) => {
// let retrievedTours = res?.data?.tours ? res.data.tours : [];
// console.log("L100 retrievedTours[0]", retrievedTours[0])
});
// });
};

return (
Expand Down Expand Up @@ -126,6 +127,7 @@ export default function TourCardContainer({
tour={tour}
city={city}
mapCard={false}
provider={provider}
/>
</Grid>
))}
Expand Down
1 change: 1 addition & 0 deletions src/views/Start/Start.js
Original file line number Diff line number Diff line change
Expand Up @@ -245,6 +245,7 @@ function Start({
isLoading={isLoading}
setIsLoading={setIsLoading}
isMobile={isMobile}
provider={searchParams.get("p")}
/>
</Box>
<Box style={{ padding: "30px 40px" }}>
Expand Down

0 comments on commit d5227f5

Please sign in to comment.