|
|
@@ -33,24 +33,13 @@ export type Props = {
|
|
33
|
33
|
value: string
|
|
34
|
34
|
};
|
|
35
|
35
|
|
|
36
|
|
-/**
|
|
37
|
|
- * The state of the component.
|
|
38
|
|
- */
|
|
39
|
|
-type State = {
|
|
40
|
|
-
|
|
41
|
|
- /**
|
|
42
|
|
- * The value entered in the field.
|
|
43
|
|
- */
|
|
44
|
|
- value: string
|
|
45
|
|
-}
|
|
46
|
|
-
|
|
47
|
36
|
/**
|
|
48
|
37
|
* An abstract React Component for entering a key for starting a YouTube live
|
|
49
|
38
|
* stream.
|
|
50
|
39
|
*
|
|
51
|
40
|
* @extends Component
|
|
52
|
41
|
*/
|
|
53
|
|
-export default class AbstractStreamKeyForm extends Component<Props, State> {
|
|
|
42
|
+export default class AbstractStreamKeyForm extends Component<Props> {
|
|
54
|
43
|
helpURL: string;
|
|
55
|
44
|
|
|
56
|
45
|
/**
|
|
|
@@ -61,10 +50,6 @@ export default class AbstractStreamKeyForm extends Component<Props, State> {
|
|
61
|
50
|
constructor(props: Props) {
|
|
62
|
51
|
super(props);
|
|
63
|
52
|
|
|
64
|
|
- this.state = {
|
|
65
|
|
- value: props.value
|
|
66
|
|
- };
|
|
67
|
|
-
|
|
68
|
53
|
this.helpURL = (typeof interfaceConfig !== 'undefined'
|
|
69
|
54
|
&& interfaceConfig.LIVE_STREAMING_HELP_LINK)
|
|
70
|
55
|
|| LIVE_STREAMING_HELP_LINK;
|
|
|
@@ -73,17 +58,6 @@ export default class AbstractStreamKeyForm extends Component<Props, State> {
|
|
73
|
58
|
this._onInputChange = this._onInputChange.bind(this);
|
|
74
|
59
|
}
|
|
75
|
60
|
|
|
76
|
|
- /**
|
|
77
|
|
- * Implements {@code Component}'s componentWillReceiveProps.
|
|
78
|
|
- *
|
|
79
|
|
- * @inheritdoc
|
|
80
|
|
- */
|
|
81
|
|
- componentWillReceiveProps(newProps: Props) {
|
|
82
|
|
- this.setState({
|
|
83
|
|
- value: newProps.value
|
|
84
|
|
- });
|
|
85
|
|
- }
|
|
86
|
|
-
|
|
87
|
61
|
_onInputChange: Object => void
|
|
88
|
62
|
|
|
89
|
63
|
/**
|
|
|
@@ -99,9 +73,6 @@ export default class AbstractStreamKeyForm extends Component<Props, State> {
|
|
99
|
73
|
_onInputChange(change) {
|
|
100
|
74
|
const value = typeof change === 'object' ? change.target.value : change;
|
|
101
|
75
|
|
|
102
|
|
- this.setState({
|
|
103
|
|
- value
|
|
104
|
|
- });
|
|
105
|
76
|
this.props.onChange(value);
|
|
106
|
77
|
}
|
|
107
|
78
|
}
|