Live location tracking and playback for the game "manhunt"

Add Edit Name

bwc9876.dev 7de05e40 970e65c3

verified
+13 -1
+13 -1
frontend/src/components/MenuScreen.tsx
··· 3 3 import { IconBuildingBroadcastTowerFilled, IconHexagonPlusFilled, IconClockFilled } from "@tabler/icons-react"; 4 4 import { commands, GameSettings, PlayerProfile } from "@/bindings"; 5 5 import ProfilePicture from "./ProfilePicture"; 6 + import { profile } from "node:console"; 6 7 7 8 // Temp settings for now. 8 9 export const tempSettings: GameSettings = { ··· 61 62 }); 62 63 }, []); 63 64 65 + const onEditName = () => { 66 + const newName = window.prompt("Enter New Name"); 67 + if (!newName) { 68 + return; 69 + } 70 + 71 + const newProfile = {...profile, display_name: newName}; 72 + commands.updateProfile(newProfile); 73 + setProfile(newProfile); 74 + }; 75 + 64 76 return <> 65 77 <header> 66 78 <ProfilePicture fallbackName={profile.display_name} src={profile.pfp_base64} /> 67 - {profile.display_name} 79 + <span className="grow" onClick={onEditName}>Hello,&nbsp;&nbsp;{profile.display_name}</span> 68 80 </header> 69 81 <main className="menu"> 70 82 <button onClick={startLobby}>