Fix GameOfSim component layout and add full-screen support
- Add showSocialShare prop to GameOfSim component for conditional social sharing - Create GameOfSimPage.tsx for standalone access without header/footer - Create GameOfSimGreenScreen.tsx for green screen mode - Add routing for /game-of-sim and /game-of-sim/:mode - Fix GamesGallery to conditionally show header/footer (only in gallery view) - Update Games.tsx to remove Layout wrapper for proper conditional rendering - Add unique ID to social share URL for copy link functionality - Ensure consistent behavior with other interactive components
This commit is contained in:
parent
8d84ac0476
commit
85a8298352
6 changed files with 105 additions and 65 deletions
|
|
@ -20,7 +20,11 @@ interface GameState {
|
|||
moveHistory: Edge[];
|
||||
}
|
||||
|
||||
const GameOfSim = () => {
|
||||
interface GameOfSimProps {
|
||||
showSocialShare?: boolean;
|
||||
}
|
||||
|
||||
const GameOfSim: React.FC<GameOfSimProps> = ({ showSocialShare = true }) => {
|
||||
const [vertices, setVertices] = useState(6);
|
||||
const [gameState, setGameState] = useState<GameState>(() => initializeGame(6));
|
||||
|
||||
|
|
@ -268,13 +272,15 @@ const GameOfSim = () => {
|
|||
</div>
|
||||
|
||||
{/* Social Share */}
|
||||
<div className="flex justify-center">
|
||||
<SocialShare
|
||||
title="Game of Sim"
|
||||
description="Play the strategic Game of Sim! Take turns coloring edges between vertices while avoiding creating triangles of your own color."
|
||||
url={`${window.location.origin}/themes/games`}
|
||||
/>
|
||||
</div>
|
||||
{showSocialShare && (
|
||||
<div className="flex justify-center">
|
||||
<SocialShare
|
||||
title="Game of Sim"
|
||||
description="Play the strategic Game of Sim! Take turns coloring edges between vertices while avoiding creating triangles of your own color."
|
||||
url={`${window.location.origin}/themes/games#game-of-sim`}
|
||||
/>
|
||||
</div>
|
||||
)}
|
||||
</CardContent>
|
||||
</Card>
|
||||
</div>
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue