//@flow import { Icon } from '@blueprintjs/core' import { List } from 'immutable'; import * as React from 'react'; import { Flex } from 'reflexbox'; import { Player } from '../../models/players'; import { RadialList } from './radial-list/RadialList'; import roundTable from './round-table.png'; type RadialPlayerListProps = { players: List, owner: string, currentPlayer: Player, }; const PlayerItem = ({player, isOwner, isUser}) => (
{player.displayName}
); const PlayerPlaceholder = () => (
?
); const UserIcon = ({isUser, isOwner, title}) => { const icon = isOwner ? 'badge' : 'user'; const intent = isUser ? 'warning' : 'none'; return ; }; export const RadialPlayerList = ({players, owner, currentPlayer}: RadialPlayerListProps) => { const orderedPlayers = placeFirst(players.toArray(), currentPlayer.username); const playerItems = orderedPlayers.map(player => ); const tableImg = Round table; return ; }; function placeFirst(players: Array, targetFirstUsername: string): Array { while (players[0].username !== targetFirstUsername) { players.push(players.shift()); } return players; } function completeWithPlaceholders(playerItems: Array): Array { while (playerItems.length < 3) { playerItems.push(); } return playerItems; }