Tally UI

CustomerDisplaySettings

CustomerDisplaySettings is Settings › Customer display, the till's paired displays, pairing a new one with a code, and forgetting one.

Import

import { CustomerDisplaySettings } from '@tallyui/components';

Usage

<CustomerDisplaySettings
  pairing={useTillPairing(pairing)}
  displays={useTillDisplays(service)}
  onStartPairing={onStartPairing}
  onConfirm={onConfirm}
  onDecline={onDecline}
  onCancelPairing={onCancelPairing}
  onForget={onForget}
/>

Props only: the app passes useTillPairing and useTillDisplays from @tallyui/pos, and wires every callback to the same TillPairing.

Paired displays lists each display by name with its state: Connected, Connecting…, Waiting for the display, or Offline. Forget asks first and calls onForget only on confirm. With no displays, it says "No displays paired yet."

Pair a display has a Pair a display button that calls onStartPairing. While a code is live, it shows the code and when it expires, then "Waiting for a display…" until a display enters it. Each display that enters the code shows its name and a check code, with Decline and Confirm; confirm only if the display shows the same check code. Cancel calls onCancelPairing.

Errors show as text: a pairing error above the button, a forget error under the list. While the store can't be reached, or the cashier may not pair displays, a line above the groups says so.

Props

PropTypeDefaultDescription
pairing{ phase: PairingPhase; forgetError: PairingError | null }requiredFrom useTillPairing(pairing)
displays{ status: TillDisplayStatus; displays: readonly TillDisplayEntry[]; pauseReason?: TillDisplayPauseReason | null }requiredFrom useTillDisplays(service); while paused with pauseReason: 'device_refused', the line says the store does not recognise this till
onStartPairing() => voidrequiredPair a display pressed
onConfirm(claimId: string) => voidrequiredConfirm pressed for a display
onDecline(claimId: string) => voidrequiredDecline pressed for a display
onCancelPairing() => voidrequiredCancel pressed
onForget(displayId: string) => voidrequiredForget confirmed
formatTime(iso: string) => stringthe device's locale, hours and minutesFormats the code's expiry
classNamestring---Override container styles

On this page