From 18f1945c197a698dd5b63d5d4d29425e5eaf9266 Mon Sep 17 00:00:00 2001 From: N-Pex Date: Thu, 17 Jun 2021 20:56:25 +0200 Subject: [PATCH] "Knowing who you are" Work on issue #128. --- package-lock.json | 4 +- src/assets/config.json | 2 + src/assets/css/chat.scss | 57 +++++++--- src/assets/translations/en.json | 15 ++- src/components/ActionRow.vue | 32 ++++++ src/components/ChatHeader.vue | 20 +++- src/components/Profile.vue | 19 ++-- src/components/ProfileInfoPopup.vue | 162 ++++++++++++++++++++++++++++ src/components/RoomInfo.vue | 29 ----- src/components/profileInfoMixin.js | 44 ++++++++ 10 files changed, 323 insertions(+), 61 deletions(-) create mode 100644 src/components/ActionRow.vue create mode 100644 src/components/ProfileInfoPopup.vue create mode 100644 src/components/profileInfoMixin.js diff --git a/package-lock.json b/package-lock.json index 01f44dc..af3a1ec 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,11 +1,11 @@ { "name": "keanuapp-weblite", - "version": "0.1.5", + "version": "0.1.9", "lockfileVersion": 2, "requires": true, "packages": { "": { - "version": "0.1.5", + "version": "0.1.9", "dependencies": { "aes-js": "^3.1.2", "axios": "^0.21.0", diff --git a/src/assets/config.json b/src/assets/config.json index 9011b2c..70a82c2 100644 --- a/src/assets/config.json +++ b/src/assets/config.json @@ -1,5 +1,7 @@ { "appName": "Keanu Weblite", + "product": "Convene", + "productLink": "letsconvene.im", "defaultServer": "https://neo.keanu.im", "useShortCodeStickers": false, "analytics": { diff --git a/src/assets/css/chat.scss b/src/assets/css/chat.scss index bcf005a..358b245 100644 --- a/src/assets/css/chat.scss +++ b/src/assets/css/chat.scss @@ -33,6 +33,18 @@ $admin-fg: white; margin-top: $chat-standard-padding-xs; margin-bottom: $chat-standard-padding-xs; } + .v-btn.avatar { + font-family: "Inter", sans-serif; + font-weight: 700; + font-size: 11 * $chat-text-size; + color: black; + background-color: white !important; + border: 1px solid black; + border-radius: $chat-standard-padding / 2; + height: $chat-standard-padding; + margin-top: $chat-standard-padding-xs; + margin-bottom: $chat-standard-padding-xs; + } } .room-list-notification-count { @@ -718,20 +730,29 @@ $admin-fg: white; font-weight: bold; margin-left: 10px; } +} - .action { - padding: 4px 20px; - cursor: pointer; - &::after { - /* divider */ - content: " "; - display: block; - margin: 10px 0px; - bottom: 0px; - height: 1px; - background-color: #e1e1e1; - width: 100%; - } +.action-row { + padding: 4px 20px; + cursor: pointer; + height: 55px; + font-family: "Inter", sans-serif; + font-size: 19px; + color: black; + position: relative; + .v-icon { + color: black !important; + } + &:not(:last-of-type):after { + /* divider */ + position: absolute; + content: " "; + display: block; + margin: 0px 10px; + bottom: 0px; + height: 1px; + background-color: #e1e1e1; + width: 100%; } } @@ -867,3 +888,13 @@ $admin-fg: white; vertical-align: middle; padding-top: 10px; } + +.avatar-32 { + font-size: 18 * $chat-text-size !important; + &.clickable { + cursor: pointer; + &:hover { + opacity: 0.7; + } + } +} \ No newline at end of file diff --git a/src/assets/translations/en.json b/src/assets/translations/en.json index e54a799..2f85a86 100644 --- a/src/assets/translations/en.json +++ b/src/assets/translations/en.json @@ -116,7 +116,16 @@ "password_new": "New password", "password_repeat": "Repeat new password", "display_name": "Display name" - + }, + "profile_info_popup": { + "you_are": "You are", + "identity": "{displayName}", + "identity_temporary": "{displayName}", + "edit_profile": "Edit profile", + "logout": "Logout", + "want_more": "Want more?", + "powered_by": "This room is powered by {product}. Learn more at {productLink} or go ahead and create another room!", + "new_room": "+ New room" }, "join": { "title": "Welcome to {roomName}", @@ -164,10 +173,6 @@ "user_you": "{user} (you)", "hide_all": "Hide", "show_all": "Show all >", - "my_profile": "My Profile", - "identity": "You are logged in as {displayName}.", - "identity_temporary": "Your identity {displayName} is temporary. You can change your name or set a password to keep it.", - "view_profile": "View", "leave_room": "Leave", "version_info": "Powered by Guardian Project. Version: {version}" }, diff --git a/src/components/ActionRow.vue b/src/components/ActionRow.vue new file mode 100644 index 0000000..47c5162 --- /dev/null +++ b/src/components/ActionRow.vue @@ -0,0 +1,32 @@ + + + + + \ No newline at end of file diff --git a/src/components/ChatHeader.vue b/src/components/ChatHeader.vue index f8c6e9e..c3ef29c 100644 --- a/src/components/ChatHeader.vue +++ b/src/components/ChatHeader.vue @@ -18,26 +18,42 @@ {{$t('room.leave')}} + + + + {{ + userAvatarLetter + }} + + + + + + + \ No newline at end of file diff --git a/src/components/RoomInfo.vue b/src/components/RoomInfo.vue index f0487e8..a74ee0d 100644 --- a/src/components/RoomInfo.vue +++ b/src/components/RoomInfo.vue @@ -170,35 +170,6 @@ > - -
{{ $t("room_info.version_info", { version: buildVersion }) }}
diff --git a/src/components/profileInfoMixin.js b/src/components/profileInfoMixin.js new file mode 100644 index 0000000..7da0444 --- /dev/null +++ b/src/components/profileInfoMixin.js @@ -0,0 +1,44 @@ +export default { + computed: { + user() { + if (!this.$matrix.matrixClient) { + return null; + } + return this.$matrix.matrixClient.getUser(this.$matrix.currentUserId); + }, + + displayName() { + if (!this.user) { + return null; + } + return (this.user.displayName || this.user.userId); + }, + + userAvatar() { + if (!this.user || !this.user.avatarUrl) { + return null; + } + return this.$matrix.matrixClient.mxcUrlToHttp(this.user.avatarUrl, 80, 80, 'scale', true); + }, + + userAvatarLetter() { + if (!this.user) { + return null; + } + return (this.user.displayName || this.user.userId.substring(1)).substring(0, 1).toUpperCase(); + }, + + passwordsMatch() { + return this.newPassword1 && this.newPassword2 && this.newPassword1 == this.newPassword2; + } + }, + methods: { + logout() { + //TODO - For guest accounts, show warning about not being able to rejoin. + this.$store.dispatch("logout"); + this.$nextTick(() => { + this.$navigation.push({path: "/login"}, -1); + }) + }, + } +} \ No newline at end of file