import React from 'react'; import { Linking, Text, View, ViewStyle } from 'react-native'; import { connect } from 'react-redux'; import { IReduxState } from '../../../../app/types'; import { _abstractMapStateToProps } from '../../../../base/dialog/functions'; import { translate } from '../../../../base/i18n/functions'; import Button from '../../../../base/ui/components/native/Button'; import Input from '../../../../base/ui/components/native/Input'; import { BUTTON_TYPES } from '../../../../base/ui/constants.native'; import AbstractStreamKeyForm, { IProps as AbstractProps } from '../AbstractStreamKeyForm'; import { getLiveStreaming } from '../functions'; import styles from './styles'; interface IProps extends AbstractProps { /** * Style of the dialogs feature. */ _dialogStyles: any; } /** * A React Component for entering a key for starting a YouTube live stream. * * @augments Component */ class StreamKeyForm extends AbstractStreamKeyForm { /** * Initializes a new {@code StreamKeyForm} instance. * * @param {IProps} props - The React {@code Component} props to initialize * the new {@code StreamKeyForm} instance with. */ constructor(props: IProps) { super(props); // Bind event handlers so they are only bound once per instance. this._onOpenGooglePrivacyPolicy = this._onOpenGooglePrivacyPolicy.bind(this); this._onOpenHelp = this._onOpenHelp.bind(this); this._onOpenYoutubeTerms = this._onOpenYoutubeTerms.bind(this); } /** * Implements React's {@link Component#render()}. * * @inheritdoc * @returns {ReactElement} */ render() { const { _dialogStyles, t } = this.props; return ( <> { this.state.showValidationError && { t('liveStreaming.invalidStreamKey') } }