diff --git a/src/components/ProfileInfoPopup.vue b/src/components/ProfileInfoPopup.vue index 24bb16a..9237276 100644 --- a/src/components/ProfileInfoPopup.vue +++ b/src/components/ProfileInfoPopup.vue @@ -9,11 +9,18 @@
{{ $t("profile_info_popup.you_are") }}
- +
@@ -96,6 +103,7 @@ export default { data() { return { showDialog: false, + editDisplayName: false }; }, computed: { @@ -168,6 +176,19 @@ export default { .username { border-radius: 4px; background-color: #f5f5f5; + + &.editable { + background-color: unset; + box-shadow: 0px 2px 6px rgb(0 0 0 / 8%); + } + + input { + width: 100%; + + &:focus { + outline: none; + } + } } .more-container { border-radius: 10px; diff --git a/src/components/profileInfoMixin.js b/src/components/profileInfoMixin.js index 7da0444..87758ec 100644 --- a/src/components/profileInfoMixin.js +++ b/src/components/profileInfoMixin.js @@ -7,11 +7,16 @@ export default { return this.$matrix.matrixClient.getUser(this.$matrix.currentUserId); }, - displayName() { - if (!this.user) { - return null; + displayName: { + get() { + if (!this.user) { + return null; + } + return (this.user.displayName || this.user.userId); + }, + set(newValue) { + this.user.displayName = newValue } - return (this.user.displayName || this.user.userId); }, userAvatar() { @@ -40,5 +45,8 @@ export default { this.$navigation.push({path: "/login"}, -1); }) }, + setDisplayName(name) { + this.$matrix.matrixClient.setDisplayName(name); + } } } \ No newline at end of file