code review

This commit is contained in:
Tudor-Ovidiu Avram
2021-05-13 14:36:19 +03:00
parent 4e4ff0f60f
commit 3ebfb1de70
10 changed files with 78 additions and 53 deletions

View File

@@ -29,6 +29,7 @@ export type Props = {
* Implements an abstract class for {@code SharedVideoDialog}.
*/
export default class AbstractSharedVideoDialog<S: *> extends Component < Props, S > {
/**
* Instantiates a new component.
*
@@ -41,26 +42,4 @@ export default class AbstractSharedVideoDialog<S: *> extends Component < Props,
}
_onSetVideoLink: string => boolean;
/**
* Validates the entered video link by extracting the id and dispatches it.
*
* It returns a boolean to comply the Dialog behaviour:
* {@code true} - the dialog should be closed.
* {@code false} - the dialog should be left open.
*
* @param {string} link - The entered video link.
* @returns {boolean}
*/
_onSetVideoLink(link: string) {
if (!link || !link.trim()) {
return false;
}
const { onPostSubmit } = this.props;
onPostSubmit(link);
return true;
}
}