Gateway page: live-page instructions (layout, audio, rename, group names, maximise); portal: maximise button per tab bar
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
This commit is contained in:
16
live/src/GroupActions.jsx
Normal file
16
live/src/GroupActions.jsx
Normal file
@@ -0,0 +1,16 @@
|
||||
import React, { useEffect, useState } from 'react'
|
||||
|
||||
// Right end of every tab bar: maximise / restore this group.
|
||||
export default function GroupActions({ api, containerApi }) {
|
||||
const [max, setMax] = useState(() => api.isMaximized())
|
||||
useEffect(() => {
|
||||
const d = containerApi.onDidMaximizedGroupChange?.(() => setMax(api.isMaximized()))
|
||||
return () => d?.dispose?.()
|
||||
}, [api, containerApi])
|
||||
const toggle = e => { e.stopPropagation(); if (api.isMaximized()) api.exitMaximized(); else api.maximize(); setMax(api.isMaximized()) }
|
||||
return (
|
||||
<div className="groupactions" onPointerDown={e => e.stopPropagation()}>
|
||||
<button className="gbtn" onClick={toggle} title={max ? 'restore' : 'maximise this window'}>{max ? '🗗' : '⛶'}</button>
|
||||
</div>
|
||||
)
|
||||
}
|
||||
Reference in New Issue
Block a user