Added Login state in profil + css
This commit is contained in:
parent
b8b4bbd1cb
commit
9620fa12d3
2 changed files with 7 additions and 6 deletions
|
|
@ -6,14 +6,14 @@ export async function openProfilePopup(profil: ClientProfil) {
|
|||
modalname.innerHTML =
|
||||
`
|
||||
<div class="profile-info">
|
||||
<div-profil-name id="profilName"> Profil of ${profil.user} </div>
|
||||
<div-login-name id="loginName"> Login Name: '${profil.loginName ?? 'Guest'}' </div>
|
||||
<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>
|
||||
</br>
|
||||
<div-login-name id="loginName"> Login ID: '${profil.userID ?? ''}' </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">About: '${profil.text}' </div>
|
||||
<div id="profile-about" class="text-2xl text-amber-500">About: '${profil.text}' </div>
|
||||
</div>
|
||||
`;
|
||||
const profilList = document.getElementById("profile-modal") ?? null;
|
||||
|
|
|
|||
|
|
@ -19,16 +19,17 @@ export async function makeProfil(fastify: FastifyInstance, user: string, socket:
|
|||
let clientProfil!: ClientProfil;
|
||||
const users: User[] = fastify.db.getAllUsers() ?? [];
|
||||
const allUsers: User | null = getUserByName(users, user);
|
||||
// console.log(color.yellow, `DEBUG LOG: 'userFound is:'${allUsers?.name}`);
|
||||
if (user === allUsers?.name) {
|
||||
// console.log(color.yellow, `DEBUG LOG: 'login Name: '${allUsers.login}' user: '${user}'`);
|
||||
let loginState = `${allUsers?.login ?? 'Guest'}`
|
||||
if (loginState !== 'Guest')
|
||||
loginState = 'Member';
|
||||
clientProfil =
|
||||
{
|
||||
command: 'makeProfil',
|
||||
destination: 'profilMsg',
|
||||
type: 'chat' as const,
|
||||
user: `${allUsers.name}`,
|
||||
loginName: `${allUsers?.login ?? 'Guest'}`,
|
||||
loginName: loginState,
|
||||
userID: `${allUsers?.id ?? ''}`,
|
||||
text: escape(allUsers.desc),
|
||||
timestamp: Date.now(),
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue