tangled
alpha
login
or
join now
bwc9876.dev
/
manhunt-app
0
fork
atom
Live location tracking and playback for the game "manhunt"
0
fork
atom
overview
issues
pulls
1
pipelines
Add Quit Button to Lobby
bwc9876.dev
1 week ago
1dbbc785
7de05e40
verified
This commit was signed with the committer's
known signature
.
bwc9876.dev
SSH Key Fingerprint:
SHA256:DanMEP/RNlSC7pAVbnXO6wzQV00rqyKj053tz4uH5gQ=
+45
-3
2 changed files
expand all
collapse all
unified
split
frontend
src
components
LobbyScreen.tsx
style.css
+14
-3
frontend/src/components/LobbyScreen.tsx
···
3
3
import { useTauriEvent } from "@/lib/hooks";
4
4
import ProfilePicture, { ProfileDecor } from "./ProfilePicture";
5
5
import { tempSettings } from "./MenuScreen";
6
6
-
import { IconCircleCheckFilled, IconCircleDashedPlus } from "@tabler/icons-react";
6
6
+
import { IconArrowBigLeftLines, IconArrowBigLeftLinesFilled, IconCircleCheckFilled, IconCircleDashedPlus } from "@tabler/icons-react";
7
7
8
8
function ProfileList({ profiles, decoration }: { profiles: [string, PlayerProfile][], decoration: ProfileDecor }) {
9
9
return <div className="lobby-pfps">
···
55
55
56
56
const isSeeker = lobbyState.teams[lobbyState.self_id] ?? false;
57
57
58
58
+
const onLeaveLobby = () => {
59
59
+
// TODO: Tauri plugin dialog instead
60
60
+
const choice = window.confirm("Are you sure you want to leave this lobby?");
61
61
+
62
62
+
if (choice) {
63
63
+
commands.quitToMenu();
64
64
+
}
65
65
+
};
66
66
+
58
67
return (
59
68
<>
60
69
<header>
61
70
<span className="grow">Lobby</span>
62
71
<span>Join: {lobbyState.join_code}</span>
63
72
</header>
64
64
-
<main>
73
73
+
<main className="lobby">
65
74
<ProfileList profiles={seekers} decoration="seeker" />
66
75
<TeamButton onClick={() => commands.switchTeams(true)} active={isSeeker} text="Seekers" deco="seeker" />
67
67
-
<div className="map" />
76
76
+
<div className="frame">
77
77
+
<button onClick={onLeaveLobby} aria-label="Leave Lobby" className="fab left"><IconArrowBigLeftLinesFilled size="2em"/></button>
78
78
+
</div>
68
79
<TeamButton onClick={() => commands.switchTeams(false)} active={!isSeeker} text="Hiders" deco="hider" />
69
80
<ProfileList profiles={hiders} decoration="hider" />
70
81
</main>
+31
frontend/src/style.css
···
101
101
}
102
102
}
103
103
104
104
+
&.lobby > div.frame {
105
105
+
flex-grow: 1;
106
106
+
background-color: #aaa;
107
107
+
position: relative;
108
108
+
overflow-y: scroll;
109
109
+
width: 100%;
110
110
+
111
111
+
button.fab {
112
112
+
background-color: black;
113
113
+
color: white;
114
114
+
border-radius: 50%;
115
115
+
box-shadow: 0 0 5px black;
116
116
+
border: none;
117
117
+
display: flex;
118
118
+
align-items: center;
119
119
+
justify-content: center;
120
120
+
font-size: 12pt;
121
121
+
padding: var(--2);
122
122
+
position: absolute;
123
123
+
bottom: var(--small);
124
124
+
125
125
+
&.left {
126
126
+
left: var(--small);
127
127
+
}
128
128
+
129
129
+
&.right {
130
130
+
right: var(--small);
131
131
+
}
132
132
+
}
133
133
+
}
134
134
+
104
135
&.menu button {
105
136
display: flex;
106
137
flex-direction: row;