Skip to content

Commit

Permalink
Merge pull request #420 from Game-as-a-Service/refactor/room
Browse files Browse the repository at this point in the history
refactor: room page style and join room logic
  • Loading branch information
JohnsonMao authored Nov 10, 2024
2 parents f566913 + 4aac061 commit 9df70cb
Show file tree
Hide file tree
Showing 74 changed files with 756 additions and 1,485 deletions.
45 changes: 2 additions & 43 deletions assets/icons/host.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
13 changes: 0 additions & 13 deletions assets/icons/logo.svg

This file was deleted.

5 changes: 5 additions & 0 deletions assets/icons/user-host.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
44 changes: 3 additions & 41 deletions assets/icons/user.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
43 changes: 0 additions & 43 deletions assets/icons/user_host.svg

This file was deleted.

45 changes: 0 additions & 45 deletions components/lobby/EnterPrivateRoomModal/EnterPrivateRoomModal.tsx

This file was deleted.

3 changes: 0 additions & 3 deletions components/lobby/EnterPrivateRoomModal/index.tsx

This file was deleted.

23 changes: 0 additions & 23 deletions components/rooms/RoomBreadcrumb.tsx

This file was deleted.

23 changes: 7 additions & 16 deletions components/rooms/RoomButtonGroup.tsx
Original file line number Diff line number Diff line change
@@ -1,40 +1,31 @@
import Button from "@/components/shared/Button/v2";
import Icon from "../shared/Icon";

type RoomButtonGroupProps = {
isHost: boolean;
isReady: boolean;
onToggleReady: () => void;
onClickLeave: () => void;
onClickClose: () => void;
onClickStart: () => void;
};

function RoomButtonGroup(props: RoomButtonGroupProps) {
const {
onToggleReady,
onClickLeave,
onClickClose,
onClickStart,
isHost,
isReady,
} = props;
const { onClickLeave, onClickClose, onClickStart, isHost } = props;

return (
<div className="flex items-center gap-4 m-4">
<Button
variant="secondary"
className="flex"
onClick={isHost ? onClickClose : onClickLeave}
>
<Icon name="LeaveGame" className="w-6 h-6" />
離開房間
</Button>
{isHost ? (
<Button variant="primary" onClick={onClickStart}>
{isHost && (
<Button variant="primary" className="flex" onClick={onClickStart}>
<Icon name="Play" className="w-6 h-6" />
開始遊戲
</Button>
) : (
<Button variant="secondary" onClick={onToggleReady}>
{isReady ? "取消準備" : "準備"}
</Button>
)}
</div>
);
Expand Down
Loading

0 comments on commit 9df70cb

Please sign in to comment.