jiti-meet/react/features/mobile/navigation/components/welcome/functions.js

38 lines
1.1 KiB
JavaScript
Raw Normal View History

// @flow
import React from 'react';
2022-01-25 12:55:57 +00:00
import { getFeatureFlag, WELCOME_PAGE_ENABLED } from '../../../../base/flags';
import { IconArrowBack } from '../../../../base/icons';
import HeaderNavigationButton
2022-01-25 12:55:57 +00:00
from '../HeaderNavigationButton';
/**
* Determines whether the {@code WelcomePage} is enabled by the app itself
* (e.g. Programmatically via the Jitsi Meet SDK for Android and iOS). Not to be
* confused with {@link isWelcomePageUserEnabled}.
*
* @param {Function|Object} stateful - The redux state or {@link getState}
* function.
* @returns {boolean} If the {@code WelcomePage} is enabled by the app, then
* {@code true}; otherwise, {@code false}.
*/
export function isWelcomePageAppEnabled(stateful: Function | Object) {
return Boolean(getFeatureFlag(stateful, WELCOME_PAGE_ENABLED));
}
/**
* Render header arrow back button for navigation.
*
* @param {Function} onPress - Callback for when the button is pressed
* function.
* @returns {ReactElement}
*/
export function renderArrowBackButton(onPress: Function) {
return (
<HeaderNavigationButton
onPress = { onPress }
src = { IconArrowBack } />
);
}