user admin visible
This commit is contained in:
@@ -216,5 +216,16 @@
|
||||
}
|
||||
|
||||
|
||||
/* .admin
|
||||
*/
|
||||
.admin p {
|
||||
flex-direction: row;
|
||||
}
|
||||
.admin :global(span) {
|
||||
margin-left: auto;
|
||||
color: gray;
|
||||
}
|
||||
|
||||
|
||||
</style>
|
||||
|
||||
|
||||
@@ -2,12 +2,13 @@
|
||||
|
||||
import { layout, current_room, settings_user } from './Store_chat';
|
||||
import { get_room_users, leave_room, get_is_admin } from './Request_rooms';
|
||||
import { User } from './Types_chat';
|
||||
import { to_print } from './Utils_chat';
|
||||
import Button from './Element_button.svelte';
|
||||
|
||||
export let back = "";
|
||||
|
||||
let users = get_room_users();
|
||||
let users: User[] = get_room_users();
|
||||
let is_admin = false;
|
||||
get_is_admin().then(response => is_admin = response);
|
||||
|
||||
@@ -81,8 +82,11 @@
|
||||
<p>list of users is loading...</p>
|
||||
{:then users}
|
||||
{#each users as user}
|
||||
<Button my_class="list" on:click={function(){user_profile(user)}}>
|
||||
{user}
|
||||
<Button my_class="list admin" on:click={function(){user_profile(user)}}>
|
||||
{user.name}
|
||||
{#if user.isadmin }
|
||||
<span>admin</span>
|
||||
{/if}
|
||||
</Button>
|
||||
{/each}
|
||||
{/await}
|
||||
|
||||
@@ -14,6 +14,12 @@ export interface Message
|
||||
type: string;
|
||||
}
|
||||
|
||||
export interface User
|
||||
{
|
||||
name: string;
|
||||
isadmin: boolean;
|
||||
}
|
||||
|
||||
export interface FetchResponse
|
||||
{
|
||||
status: number;
|
||||
@@ -21,7 +27,7 @@ export interface FetchResponse
|
||||
code?: string;
|
||||
message?: string;
|
||||
messages?: Message[];
|
||||
users?: string[];
|
||||
users?: User[];
|
||||
room?: Room;
|
||||
rooms?: Room[];
|
||||
is_admin?: boolean;
|
||||
|
||||
Reference in New Issue
Block a user