2018-04-26 12:44:23 +00:00
|
|
|
// @flow
|
|
|
|
|
|
|
|
import React, { Component } from 'react';
|
|
|
|
import { View } from 'react-native';
|
|
|
|
|
2018-05-10 23:01:55 +00:00
|
|
|
import { getLocalParticipant } from '../../../base/participants';
|
2019-03-21 16:38:29 +00:00
|
|
|
import { connect } from '../../../base/redux';
|
2018-04-26 12:44:23 +00:00
|
|
|
|
2019-03-27 10:23:41 +00:00
|
|
|
import styles from './styles';
|
2018-04-26 12:44:23 +00:00
|
|
|
import Thumbnail from './Thumbnail';
|
|
|
|
|
|
|
|
type Props = {
|
|
|
|
|
|
|
|
/**
|
|
|
|
* The local participant.
|
|
|
|
*/
|
|
|
|
_localParticipant: Object
|
|
|
|
};
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Component to render a local thumbnail that can be separated from the
|
|
|
|
* remote thumbnails later.
|
|
|
|
*/
|
|
|
|
class LocalThumbnail extends Component<Props> {
|
|
|
|
/**
|
|
|
|
* Implements React Component's render.
|
|
|
|
*
|
|
|
|
* @inheritdoc
|
|
|
|
*/
|
|
|
|
render() {
|
|
|
|
const { _localParticipant } = this.props;
|
|
|
|
|
|
|
|
return (
|
|
|
|
<View style = { styles.localThumbnail }>
|
|
|
|
<Thumbnail participant = { _localParticipant } />
|
|
|
|
</View>
|
|
|
|
);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Maps (parts of) the redux state to the associated {@code LocalThumbnail}'s
|
|
|
|
* props.
|
|
|
|
*
|
|
|
|
* @param {Object} state - The redux state.
|
|
|
|
* @private
|
|
|
|
* @returns {{
|
|
|
|
* _localParticipant: Participant
|
|
|
|
* }}
|
|
|
|
*/
|
|
|
|
function _mapStateToProps(state) {
|
|
|
|
return {
|
|
|
|
/**
|
|
|
|
* The local participant.
|
|
|
|
*
|
|
|
|
* @private
|
|
|
|
* @type {Participant}
|
|
|
|
*/
|
|
|
|
_localParticipant: getLocalParticipant(state)
|
|
|
|
};
|
|
|
|
}
|
|
|
|
|
|
|
|
export default connect(_mapStateToProps)(LocalThumbnail);
|