feat(chat): fixed typo in profile command and improved profile in chat
This commit is contained in:
parent
3e1dd0fdd9
commit
69ba60b03d
6 changed files with 28 additions and 16 deletions
|
|
@ -6,6 +6,18 @@
|
|||
|
||||
@tailwind utilities;
|
||||
|
||||
.recessed {
|
||||
@apply
|
||||
inline-block
|
||||
bg-gray-100
|
||||
text-gray-800
|
||||
p-2
|
||||
rounded-md
|
||||
shadow-inner
|
||||
border
|
||||
border-gray-300;
|
||||
}
|
||||
|
||||
.btn-style {
|
||||
@apply
|
||||
w-25
|
||||
|
|
|
|||
|
|
@ -103,7 +103,7 @@ function parseCmdMsg(msgText: string): string[] | undefined {
|
|||
return command;
|
||||
}
|
||||
|
||||
const ArgCommands = ['@profil', '@block'];
|
||||
const ArgCommands = ['@profile', '@block'];
|
||||
const userName = msgText.indexOf(" ");
|
||||
const cmd2 = msgText.slice(0, userName).trim() ?? "";
|
||||
const user = msgText.slice(userName + 1).trim();
|
||||
|
|
@ -426,7 +426,7 @@ function handleChat(_url: string, _args: RouteHandlerParams): RouteHandlerReturn
|
|||
inviteMsgFlag = false;
|
||||
}
|
||||
break;
|
||||
case '@profil':
|
||||
case '@profile':
|
||||
if (msgCommand[1] === '') {break;};
|
||||
getProfil(socket, msgCommand[1]);
|
||||
break;
|
||||
|
|
@ -437,7 +437,7 @@ function handleChat(_url: string, _args: RouteHandlerParams): RouteHandlerReturn
|
|||
addMessage('*');
|
||||
addMessage('** ********** List of @cmds ********** **');
|
||||
addMessage('\'@cls\' - clear chat screen conversations');
|
||||
addMessage('\'@profil <name>\' - pulls ups user profil');
|
||||
addMessage('\'@profile <name>\' - pulls ups user profile');
|
||||
addMessage('\'@notify\' - toggles notifications on / off');
|
||||
addMessage('\'@quit\' - disconnect user from the chat');
|
||||
addMessage('** *********************************** **');
|
||||
|
|
|
|||
|
|
@ -10,7 +10,7 @@ import { Socket } from 'socket.io-client';
|
|||
export function getProfil(socket: Socket, user: string) {
|
||||
if (!socket.connected) return;
|
||||
const profil = {
|
||||
command: '@profil',
|
||||
command: '@profile',
|
||||
destination: 'profilMessage',
|
||||
type: "chat",
|
||||
user: user,
|
||||
|
|
|
|||
|
|
@ -6,17 +6,17 @@ export async function openProfilePopup(profil: ClientProfil) {
|
|||
modalname.innerHTML =
|
||||
`
|
||||
<div class="profile-info">
|
||||
<div-profil-name id="profilName" class="text-xl font-bold text-blue-500"> Profil of ${profil.user} </div>
|
||||
<div-login-name id="loginName"> Login status: '${profil.loginName ?? 'Guest'}' </div>
|
||||
<div-profil-name id="profilName" class="text-xl font-bold text-blue-500"> Profile of ${profil.user} </div>
|
||||
<div-login-name id="loginName"> Login status: <span class="recessed">${profil.loginName ?? 'Guest'}</span> </div>
|
||||
</br>
|
||||
<div-login-name id="loginName"> Login ID: '${profil.userID ?? ''}' </div>
|
||||
<div-login-name id="loginName"> Login ID: <span class="recessed">${profil.userID ?? ''}</span> </div>
|
||||
</br>
|
||||
<button id="popup-b-invite" class="btn-style popup-b-invite">U Game ?</button>
|
||||
<button id="popup-b-block" class="btn-style popup-b-block">Block User</button>
|
||||
<div id="profile-about" class="text-2xl text-amber-500">About: '${profil.text}' </div>
|
||||
<div id="profile-about" class="text-2xl">About: <span class="recessed text-amber-500">${profil.text}</span> </div>
|
||||
</div>
|
||||
`;
|
||||
const profilList = document.getElementById("profile-modal") ?? null;
|
||||
if (profilList)
|
||||
profilList.classList.remove("hidden");
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue