import React, { useState, useEffect } from 'react'; import { PhoneFrame } from './sketchy'; import { screenGroups, type Screen } from '../screens'; import { ThemeToggle } from './ThemeToggle'; function useIsMobile(breakpoint = 768) { const [isMobile, setIsMobile] = useState(window.innerWidth < breakpoint); useEffect(() => { const handleResize = () => setIsMobile(window.innerWidth < breakpoint); window.addEventListener('resize', handleResize); return () => window.removeEventListener('resize', handleResize); }, [breakpoint]); return isMobile; } interface GalleryProps { onSelectScreen: (screenId: string) => void; onShowStories: () => void; onShowSpecs?: () => void; } const MIN_SCALE = 0.32; const MAX_SCALE = 0.75; const DEFAULT_SCALE = 0.5; export function Gallery({ onSelectScreen, onShowStories, onShowSpecs }: GalleryProps) { const [scale, setScale] = useState(DEFAULT_SCALE); const isMobile = useIsMobile(); return (
Cliquez sur un écran pour le prévisualiser
{screen.name}