Merge pull request #56 from havfo/feat/list-me

Show Me in the users tab
master
Håvar Aambø Fosstveit 2018-08-02 12:00:16 +02:00 committed by GitHub
commit 5638b37bac
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 41 additions and 0 deletions

View File

@ -0,0 +1,38 @@
import React from 'react';
import { connect } from 'react-redux';
import { Me } from '../appPropTypes';
const ListMe = ({ me }) =>
{
const picture = me.picture || 'resources/images/avatar-empty.jpeg';
return (
<li className='list-item'>
<div data-component='ListPeer'>
<img className='avatar' src={picture} />
<div className='peer-info'>
{me.displayName}
</div>
<div className='indicators'>
{me.raisedHand && (
<div className='icon raise-hand on' />
)}
</div>
</div>
</li>
);
};
ListMe.propTypes = {
me : Me.isRequired
};
const mapStateToProps = (state) => ({
me : state.me
});
export default connect(
mapStateToProps
)(ListMe);

View File

@ -5,6 +5,7 @@ import * as requestActions from '../../redux/requestActions';
import * as stateActions from '../../redux/stateActions';
import PropTypes from 'prop-types';
import ListPeer from './ListPeer';
import ListMe from './ListMe';
class ParticipantList extends React.Component
{
@ -23,6 +24,8 @@ class ParticipantList extends React.Component
return (
<div data-component='ParticipantList'>
<ul className='list'>
<ListMe />
{
peers.map((peer) =>
{