Live location tracking and playback for the game "manhunt"

Add Quit Button to Lobby

bwc9876.dev 1dbbc785 7de05e40

verified
+45 -3
+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 - import { IconCircleCheckFilled, IconCircleDashedPlus } from "@tabler/icons-react"; 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 + const onLeaveLobby = () => { 59 + // TODO: Tauri plugin dialog instead 60 + const choice = window.confirm("Are you sure you want to leave this lobby?"); 61 + 62 + if (choice) { 63 + commands.quitToMenu(); 64 + } 65 + }; 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 - <main> 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 - <div className="map" /> 76 + <div className="frame"> 77 + <button onClick={onLeaveLobby} aria-label="Leave Lobby" className="fab left"><IconArrowBigLeftLinesFilled size="2em"/></button> 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 + &.lobby > div.frame { 105 + flex-grow: 1; 106 + background-color: #aaa; 107 + position: relative; 108 + overflow-y: scroll; 109 + width: 100%; 110 + 111 + button.fab { 112 + background-color: black; 113 + color: white; 114 + border-radius: 50%; 115 + box-shadow: 0 0 5px black; 116 + border: none; 117 + display: flex; 118 + align-items: center; 119 + justify-content: center; 120 + font-size: 12pt; 121 + padding: var(--2); 122 + position: absolute; 123 + bottom: var(--small); 124 + 125 + &.left { 126 + left: var(--small); 127 + } 128 + 129 + &.right { 130 + right: var(--small); 131 + } 132 + } 133 + } 134 + 104 135 &.menu button { 105 136 display: flex; 106 137 flex-direction: row;