Tally UI

StoreSettingsChoiceScreen

Ask which region, country and sales channel a till sells in when the store's settings need a choice.

Import

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

Usage

<StoreSettingsChoiceScreen choices={error.choices} initial={storedChoice}
  onSubmit={(choice) => saveChoiceAndRetry(choice)} />

Show this screen when storeSettings rejects with choice_required. The app persists the returned choice per store and calls storeSettings again with it. Only the sections present in choices are shown. A section with one option starts selected; otherwise a matching initial value is pre-selected. Continue stays disabled until every shown section has a choice. The submitted choice lower-cases the country code and keeps initial values for sections that are not shown.

Props

StoreSettingsChoiceScreenProps extends the React Native ViewProps, without children.

PropTypeDefaultDescription
choicesStoreSettingsChoicesrequiredFrom StoreSettingsError.choices; optional regions, countries and channels
initialStoreSettingsChoice—A previous choice to pre-select; fields not in choices are ignored
onSubmit(choice: StoreSettingsChoice) => voidrequiredCalled with the full choice when the user confirms
countryName(code: string) => stringIntl.DisplayNames in localeDisplay name for an ISO 3166-1 alpha-2 code; falls back to the upper-cased code
localestring'en'Locale of the default country names
titlestring'Set up this till'Screen title
bodystring'This store sells in more than one place. Choose where this till is.'Text under the title
regionLabelstring'Region'Heading of the region section
countryLabelstring'Country'Heading of the country section
channelLabelstring'Sales channel'Heading of the channel section
submitLabelstring'Continue'Label of the submit button
classNamestring—Extra classes for the outer view

On this page