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 Edit Name
bwc9876.dev
1 week ago
7de05e40
970e65c3
verified
This commit was signed with the committer's
known signature
.
bwc9876.dev
SSH Key Fingerprint:
SHA256:DanMEP/RNlSC7pAVbnXO6wzQV00rqyKj053tz4uH5gQ=
+13
-1
1 changed file
expand all
collapse all
unified
split
frontend
src
components
MenuScreen.tsx
+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
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
65
+
const onEditName = () => {
66
66
+
const newName = window.prompt("Enter New Name");
67
67
+
if (!newName) {
68
68
+
return;
69
69
+
}
70
70
+
71
71
+
const newProfile = {...profile, display_name: newName};
72
72
+
commands.updateProfile(newProfile);
73
73
+
setProfile(newProfile);
74
74
+
};
75
75
+
64
76
return <>
65
77
<header>
66
78
<ProfilePicture fallbackName={profile.display_name} src={profile.pfp_base64} />
67
67
-
{profile.display_name}
79
79
+
<span className="grow" onClick={onEditName}>Hello, {profile.display_name}</span>
68
80
</header>
69
81
<main className="menu">
70
82
<button onClick={startLobby}>