blob: baee67c10b7edf9ac62c55d9cf7469cfabf6b418 (
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
28
|
// @flow
import { Text } from '@blueprintjs/core';
import React from 'react';
import { connect } from 'react-redux';
import type { GlobalState } from '../../reducers';
import type { User } from '../../redux/user';
import { getCurrentUser } from '../../redux/user';
type PlayerInfoProps = {
user: ?User,
}
const PlayerInfoPresenter = ({user}: PlayerInfoProps) => (
<Text>
<b>Username:</b>
{' '}
{user && user.displayName}
</Text>
);
const mapStateToProps = (state: GlobalState): PlayerInfoProps => ({
user: getCurrentUser(state),
});
const mapDispatchToProps = {
};
export const PlayerInfo = connect(mapStateToProps, mapDispatchToProps)(PlayerInfoPresenter);
|