Tally UI

LiveTabScreen

Show what a browser tab draws once it is no longer the live POS tab, with a button to take over or reload.

Import

import { LiveTabScreen, type LiveTabScreenState } from '@tallyui/components';

Usage

<LiveTabScreen state={liveTabState} onUseHere={takeOver} onReload={() => window.location.reload()} />

The screen renders nothing for acquiring and live. For parked it shows the title, the parked body and a Use here button that calls onUseHere. For blocked it shows the same title, the blocked body and a Reload button that calls onReload. Other View props pass through to the outer view.

Props

LiveTabScreenProps extends the React Native ViewProps, without children.

PropTypeDefaultDescription
stateLiveTabScreenStaterequiredThe tab's state
onUseHere() => voidrequiredCalled when the parked screen's button is pressed
onReload() => voidrequiredCalled when the blocked screen's button is pressed
parkedTitlestring'POS is open in another tab'Title for both the parked and the blocked screen
parkedBodystring'This tab stopped so the other one can work. Use it here instead?'Body of the parked screen
useHereLabelstring'Use here'Label of the parked screen's button
blockedBodystring'The POS is open in another tab. Close that tab to use it here, or reload this one.'Body of the blocked screen
reloadLabelstring'Reload'Label of the blocked screen's button
classNamestring—Extra classes for the outer view

LiveTabScreenState

type LiveTabScreenState = 'acquiring' | 'live' | 'parked' | 'blocked';

It mirrors LiveTabState from @tallyui/database, without depending on that package.