Skip to content

Commit

Permalink
feat(webapp-client): add ActionBoard with basic style
Browse files Browse the repository at this point in the history
  • Loading branch information
kuoabu authored and ben196888 committed Jun 2, 2024
1 parent dba6e18 commit ebae826
Show file tree
Hide file tree
Showing 2 changed files with 30 additions and 0 deletions.
2 changes: 2 additions & 0 deletions client/src/BoardGame.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,14 @@ import { Client, BoardProps } from 'boardgame.io/react';
import { Local } from 'boardgame.io/multiplayer';
import { OpenStarTerVillageType } from 'packages/game/src/types';
import Table from './features/Table/Table';
import ActionBoard from './features/ActionBoard/ActionBoard';
import Players from './Players/Players';
import DevActions from './DevActions/DevActions';

const Board: React.FC<BoardProps<OpenStarTerVillageType.State.Root>> = (props) => {
return (
<div className='Board'>
<ActionBoard {...props} />
<Table {...props} />
<Players {...props} />
<DevActions {...props} />
Expand Down
28 changes: 28 additions & 0 deletions client/src/features/ActionBoard/ActionBoard.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
import * as React from 'react';
import { BoardProps } from 'boardgame.io/react';
import { OpenStarTerVillageType as Type } from 'packages/game/src/types';
import { Box, Heading, ButtonGroup, Button } from '@chakra-ui/react'

const ActionBoard: React.FC<BoardProps<Type.State.Root>> = (props) => {
const playerID = props.playerID;
const currentPlayer = props.ctx.currentPlayer;

return (
<>
<Box m="4" p="4" border="1px" borderRadius="lg" borderColor="gray.100">
<Heading size="xs">Current Player: {currentPlayer}</Heading>
</Box>
<Box m="4" p="4" border="1px" borderRadius="lg" borderColor="gray.100">
{playerID === currentPlayer && (
<ButtonGroup size='sm' spacing='6'>
<Button>Create Project</Button>
<Button disabled>Move 2</Button>
<Button disabled>Move 3</Button>
</ButtonGroup>
)}
</Box>
</>
);
};

export default ActionBoard;

0 comments on commit ebae826

Please sign in to comment.