import { Theme } from '@mui/material'; import React from 'react'; import { connect } from 'react-redux'; import { withStyles } from 'tss-react/mui'; import { translate } from '../../../../base/i18n/functions'; import { withPixelLineHeight } from '../../../../base/styles/functions.web'; import Input from '../../../../base/ui/components/web/Input'; import AbstractStreamKeyForm, { IProps as AbstractProps, _mapStateToProps } from '../AbstractStreamKeyForm'; interface IProps extends AbstractProps { /** * An object containing the CSS classes. */ classes?: Partial, string>>; } const styles = (theme: Theme) => { return { helperLink: { cursor: 'pointer', color: theme.palette.link01, transition: 'color .2s ease', ...withPixelLineHeight(theme.typography.labelBold), marginLeft: 'auto', marginTop: theme.spacing(1), '&:hover': { textDecoration: 'underline', color: theme.palette.link01Hover }, '&:active': { color: theme.palette.link01Active } } }; }; /** * A React Component for entering a key for starting a YouTube live stream. * * @augments Component */ class StreamKeyForm extends AbstractStreamKeyForm { /** * Implements React's {@link Component#render()}. * * @inheritdoc * @returns {ReactElement} */ render() { const { t, value } = this.props; const classes = withStyles.getClasses(this.props); return (
{ this.state.showValidationError ? { t('liveStreaming.invalidStreamKey') } : null } { this.props._liveStreaming.helpURL ? { t('liveStreaming.streamIdHelp') } : null }
{ t('liveStreaming.youtubeTerms') } { t('liveStreaming.googlePrivacyPolicy') }
); } } export default translate(connect(_mapStateToProps)(withStyles(StreamKeyForm, styles)));