Fix "Back to Puzzles" link

Ensure "Back to Puzzles" link is displayed correctly on the pebble placement interactive page when accessed via the puzzles section.
This commit is contained in:
gpt-engineer-app[bot] 2025-08-21 11:02:06 +00:00
parent 2fb52c752a
commit dcdfa9e5f5

View file

@ -1,6 +1,28 @@
import PebblePlacementGame from "@/components/PebblePlacementGame"; import PebblePlacementGame from "@/components/PebblePlacementGame";
import { useSearchParams } from "react-router-dom";
const PebblePlacementGamePage = () => { const PebblePlacementGamePage = () => {
const [searchParams] = useSearchParams();
const from = searchParams.get('from');
if (from === 'puzzles') {
return (
<div className="min-h-screen bg-background">
<div className="container mx-auto px-4 py-8 space-y-6">
<div className="flex items-center gap-4">
<button
onClick={() => window.location.href = '/themes/puzzles'}
className="text-primary hover:text-primary/80 font-medium"
>
Back to Puzzles
</button>
</div>
<PebblePlacementGame showSocialShare={true} />
</div>
</div>
);
}
return <PebblePlacementGame showSocialShare={true} />; return <PebblePlacementGame showSocialShare={true} />;
}; };