Type alias ScrollGroupSelectorProps

ScrollGroupSelectorProps: {
    availableScrollGroupIds: (ScrollGroupId | undefined)[];
    localizedStrings?: LanguageStrings;
    onChangeScrollGroupId: ((newScrollGroupId) => void);
    scrollGroupId: ScrollGroupId | undefined;
}

Type declaration

  • availableScrollGroupIds: (ScrollGroupId | undefined)[]

    List of scroll group ids to show to the user. Either a ScrollGroupId or undefined for no scroll group

  • Optional localizedStrings?: LanguageStrings

    Localized 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.

    Example

    const myScrollGroupIdLocalizedStrings = {
    [getLocalizeKeyForScrollGroupId('undefined')]: 'Ø',
    [getLocalizeKeyForScrollGroupId(0)]: 'A',
    [getLocalizeKeyForScrollGroupId(1)]: 'B',
    [getLocalizeKeyForScrollGroupId(2)]: 'C',
    [getLocalizeKeyForScrollGroupId(3)]: 'D',
    [getLocalizeKeyForScrollGroupId(4)]: 'E',
    };

    Example

    const availableScrollGroupIds = [undefined, 0, 1, 2, 3, 4];

    const localizeKeys = getLocalizeKeysForScrollGroupIds();

    const [localizedStrings] = useLocalizedStrings(localizeKeys);

    ...

    <ScrollGroupSelector localizedStrings={localizedStrings} />
  • onChangeScrollGroupId: ((newScrollGroupId) => void)

    Callback function run when the user tries to change the scroll group id

      • (newScrollGroupId): void
      • Parameters

        • newScrollGroupId: ScrollGroupId | undefined

        Returns void

  • scrollGroupId: ScrollGroupId | undefined

    Currently selected scroll group id. undefined for no scroll group