Optional
localizedLocalized strings to use for displaying scroll group ids. Must be an object whose keys are
getLocalizeKeyForScrollGroupId(scrollGroupId)
for all scroll group ids (and undefined
if
included) in ScrollGroupSelectorProps.availableScrollGroupIds and whose values are the
localized strings to use for those scroll group ids.
Defaults to English localizations of English alphabet for scroll groups 0-25 (e.g. 0 is A) and
Ø for undefined
. Will fill in any that are not provided with these English localizations.
Also, if any values match the keys, the English localization will be used. This is useful in
case you want to pass in a temporary version of the localized strings while your localized
strings load.
const myScrollGroupIdLocalizedStrings = {
[getLocalizeKeyForScrollGroupId('undefined')]: 'Ø',
[getLocalizeKeyForScrollGroupId(0)]: 'A',
[getLocalizeKeyForScrollGroupId(1)]: 'B',
[getLocalizeKeyForScrollGroupId(2)]: 'C',
[getLocalizeKeyForScrollGroupId(3)]: 'D',
[getLocalizeKeyForScrollGroupId(4)]: 'E',
};
const availableScrollGroupIds = [undefined, 0, 1, 2, 3, 4];
const localizeKeys = getLocalizeKeysForScrollGroupIds();
const [localizedStrings] = useLocalizedStrings(localizeKeys);
...
<ScrollGroupSelector localizedStrings={localizedStrings} />
Callback function run when the user tries to change the scroll group id
Currently selected scroll group id. undefined
for no scroll group
List of scroll group ids to show to the user. Either a ScrollGroupId or
undefined
for no scroll group