thumbnail: use a functional component
Simplifies the code a bit, and we use no lifecycle methods.
This commit is contained in:
parent
d1be5742ba
commit
bcc1be675f
|
@ -1,6 +1,6 @@
|
|||
// @flow
|
||||
|
||||
import React, { Component } from 'react';
|
||||
import React from 'react';
|
||||
import { View } from 'react-native';
|
||||
import type { Dispatch } from 'redux';
|
||||
|
||||
|
@ -111,16 +111,10 @@ type Props = {
|
|||
/**
|
||||
* React component for video thumbnail.
|
||||
*
|
||||
* @extends Component
|
||||
* @param {Props} props - Properties passed to this functional component.
|
||||
* @returns {Component} - A React component.
|
||||
*/
|
||||
class Thumbnail extends Component<Props> {
|
||||
/**
|
||||
* Implements React's {@link Component#render()}.
|
||||
*
|
||||
* @inheritdoc
|
||||
* @returns {ReactElement}
|
||||
*/
|
||||
render() {
|
||||
function Thumbnail(props: Props) {
|
||||
const {
|
||||
_audioMuted: audioMuted,
|
||||
_largeVideo: largeVideo,
|
||||
|
@ -134,7 +128,7 @@ class Thumbnail extends Component<Props> {
|
|||
participant,
|
||||
renderDisplayName,
|
||||
tileView
|
||||
} = this.props;
|
||||
} = props;
|
||||
|
||||
const participantId = participant.id;
|
||||
const participantInLargeVideo
|
||||
|
@ -197,7 +191,6 @@ class Thumbnail extends Component<Props> {
|
|||
|
||||
</Container>
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
Loading…
Reference in New Issue