From 96cea7997677e121990557ed025232470a7178c6 Mon Sep 17 00:00:00 2001 From: Sisi Date: Sun, 10 May 2026 20:40:56 +0200 Subject: [PATCH] add user feature --- client/src/Relations/ListElement.tsx | 5 +++++ client/src/Relations/Relations.tsx | 7 +++++++ client/src/features/users/components/UserBlock.tsx | 13 +++++++++++++ client/src/features/users/types.tsx | 11 +++++++++++ client/src/left aside/Relations.tsx | 7 ------- packages/types/types.go | 6 +++--- 6 files changed, 39 insertions(+), 10 deletions(-) create mode 100644 client/src/Relations/ListElement.tsx create mode 100644 client/src/Relations/Relations.tsx create mode 100644 client/src/features/users/components/UserBlock.tsx create mode 100644 client/src/features/users/types.tsx delete mode 100644 client/src/left aside/Relations.tsx diff --git a/client/src/Relations/ListElement.tsx b/client/src/Relations/ListElement.tsx new file mode 100644 index 0000000..cf1491d --- /dev/null +++ b/client/src/Relations/ListElement.tsx @@ -0,0 +1,5 @@ +function ListElement() { + return ( + + ) +} \ No newline at end of file diff --git a/client/src/Relations/Relations.tsx b/client/src/Relations/Relations.tsx new file mode 100644 index 0000000..6ce7d66 --- /dev/null +++ b/client/src/Relations/Relations.tsx @@ -0,0 +1,7 @@ +function Relations() { + return ( + + ) +} \ No newline at end of file diff --git a/client/src/features/users/components/UserBlock.tsx b/client/src/features/users/components/UserBlock.tsx new file mode 100644 index 0000000..ef3ce22 --- /dev/null +++ b/client/src/features/users/components/UserBlock.tsx @@ -0,0 +1,13 @@ +import type {User} from "../types"; + +function UserBlock(user: User) { + return ( +
+ avatar +
+

{user.name}

+

{user.pronouns}

+
+
+ ) +} \ No newline at end of file diff --git a/client/src/features/users/types.tsx b/client/src/features/users/types.tsx new file mode 100644 index 0000000..93bec83 --- /dev/null +++ b/client/src/features/users/types.tsx @@ -0,0 +1,11 @@ +export interface User { + id: string; + name: string; + pronouns: string; + description: string; + avatarKey?: string; + background?: string; + createdAt: string; + hubs?: string; // TODO + color: number[]; +} \ No newline at end of file diff --git a/client/src/left aside/Relations.tsx b/client/src/left aside/Relations.tsx deleted file mode 100644 index fb87408..0000000 --- a/client/src/left aside/Relations.tsx +++ /dev/null @@ -1,7 +0,0 @@ -function Relations() { - return ( - - ) -} \ No newline at end of file diff --git a/packages/types/types.go b/packages/types/types.go index dfe5718..0630792 100644 --- a/packages/types/types.go +++ b/packages/types/types.go @@ -31,14 +31,14 @@ type User struct { Name string `json:"name"` Pronouns string `json:"pronouns"` Description string `json:"description"` - AvatarKey string `json:"avatarType"` - ProfileBgKey string `json:"profileBackgroundType"` + AvatarKey string `json:"avatarKey"` + ProfileBgKey string `json:"profileBackgroundKey"` PasswordHash string `json:"-"` CreatedAt time.Time `json:"createdAt"` WsConn *websocket.Conn `json:"-"` Id uuid.UUID `json:"-"` Connections map[uuid.UUID]*Connection `json:"-"` - Hubs map[uuid.UUID]*Hub `json:"hubs-to-delete"` + Hubs map[uuid.UUID]*Hub `json:"hubs"` ChannelUnreadMessage map[uuid.UUID]uint8 `json:"-"` Color Rgba `json:"color"` }