Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

refactor: room page style and join room logic #420

Merged
merged 11 commits into from
Nov 10, 2024
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
Loading