({showArrows}: {showArrows?: boolean} = {})
| 34 | const MD = `@container (min-width: ${768 / 16}rem)`; |
| 35 | |
| 36 | export function ExampleApp({showArrows}: {showArrows?: boolean} = {}) { |
| 37 | let [page, setPage] = useState<'photos' | 'home' | 'ideas'>('photos'); |
| 38 | let [[detail, img] = [], setDetail] = useState<[any, HTMLImageElement] | []>([]); |
| 39 | |
| 40 | return ( |
| 41 | <ColorSchemeProvider> |
| 42 | <div |
| 43 | data-container |
| 44 | className={style({containerType: 'inline-size', height: 'full', position: 'relative'})}> |
| 45 | <AppFrame page={page} onPageChange={setPage} hidden={!!detail}> |
| 46 | {page === 'photos' && <Photos onAction={setDetail} />} |
| 47 | {page === 'home' && <HomePage />} |
| 48 | {page === 'ideas' && <Ideas />} |
| 49 | </AppFrame> |
| 50 | {!detail && page === 'home' && showArrows && <HomeArrows />} |
| 51 | {!detail && page === 'photos' && showArrows && ( |
| 52 | <Arrows> |
| 53 | <Arrow textX={75} x1={120} x2={160} y={130} href="Button"> |
| 54 | Button |
| 55 | </Arrow> |
| 56 | <Arrow textX={38} x1={120} x2={160} y={618} href="ActionButton"> |
| 57 | ActionButton |
| 58 | </Arrow> |
| 59 | <Arrow textX={632} y={24} points="662,34 662,64" marker="markerEnd" href="SearchField"> |
| 60 | SearchField |
| 61 | </Arrow> |
| 62 | <Arrow textX={1040} y={24} points="1064,34 1064,64" marker="markerEnd" href="Popover"> |
| 63 | Popover |
| 64 | </Arrow> |
| 65 | <Arrow textX={1206} x1={1198} x2={1158} y={82} marker="markerEnd" href="Menu"> |
| 66 | Menu |
| 67 | </Arrow> |
| 68 | <Arrow |
| 69 | textX={1206} |
| 70 | x1={1198} |
| 71 | x2={1142} |
| 72 | y={150} |
| 73 | marker="markerEnd" |
| 74 | href="SegmentedControl"> |
| 75 | SegmentedControl |
| 76 | </Arrow> |
| 77 | <Arrow textX={1206} x1={1198} x2={1142} y={350} marker="markerEnd" href="CardView"> |
| 78 | CardView |
| 79 | </Arrow> |
| 80 | </Arrows> |
| 81 | )} |
| 82 | {!detail && page === 'ideas' && showArrows && <IdeasArrows />} |
| 83 | {detail && img && ( |
| 84 | <Detail detail={detail} img={img} setDetail={setDetail} showArrows={showArrows} /> |
| 85 | )} |
| 86 | </div> |
| 87 | </ColorSchemeProvider> |
| 88 | ); |
| 89 | } |
| 90 | |
| 91 | function Detail({detail, img, setDetail, showArrows}: any) { |
| 92 | let [panel, setPanel] = useState('properties'); |
nothing calls this directly
no outgoing calls
no test coverage detected