Refactor standalone page

This commit is contained in:
gpt-engineer-app[bot] 2025-09-05 06:22:59 +00:00
parent 647963600f
commit 0485afd776
2 changed files with 30 additions and 2 deletions

View file

@ -1,9 +1,20 @@
import { useEffect, useState } from "react";
import Layout from "@/components/Layout";
import CrapsGame from "@/components/CrapsGame";
const CrapsGamePage = () => {
const [showBackLink, setShowBackLink] = useState(false);
useEffect(() => {
// Check if user came from games page
const referrer = document.referrer;
if (referrer.includes('/themes/games') && !referrer.includes('/themes/games/craps-game')) {
setShowBackLink(true);
}
}, []);
return (
<Layout>
<Layout showBackToGames={showBackLink}>
<CrapsGame showSocialShare={true} />
</Layout>
);