summaryrefslogtreecommitdiff
path: root/frontend/src/components/game-browser/PlayerInfo.jsx
blob: 2f29ea606497b2a55cef6d795eee7cc04ebae8ad (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
// @flow
import { Text } from '@blueprintjs/core';
import React from 'react';
import { connect } from 'react-redux';
import type { Player } from '../../models/players';
import { getCurrentPlayer } from '../../redux/players';

type PlayerInfoProps = {
  player: ?Player,
}

const PlayerInfoPresenter = ({player}: PlayerInfoProps) => (
    <Text>
      <b>Username:</b>
      {' '}
      {player && player.displayName}
    </Text>
);

const mapStateToProps = state => ({
  player: getCurrentPlayer(state),
});

const mapDispatchToProps = {
};

export const PlayerInfo = connect(mapStateToProps, mapDispatchToProps)(PlayerInfoPresenter);
bgstack15