From eae24892541973dd01443dfa29d6087c7deb0626 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Luk=C3=A1=C5=A1=20Tinkl?= Date: Fri, 19 Apr 2024 00:02:13 +0200 Subject: [PATCH] fix(ProfileDialogView): wrap bio in a scroll view - also trim the leading/trailing whitespace - fixes long bio (mainly due to linebreaks) pushing down everything below and also overflowing the preview - adjust SB page to include such example bio Fixes #14463 Fixes #14465 --- storybook/pages/ProfileDialogViewPage.qml | 24 +++++++++---------- ui/imports/shared/views/ProfileDialogView.qml | 18 ++++++++++---- 2 files changed, 25 insertions(+), 17 deletions(-) diff --git a/storybook/pages/ProfileDialogViewPage.qml b/storybook/pages/ProfileDialogViewPage.qml index 4a12ea0ccb..7bfd6c6e30 100644 --- a/storybook/pages/ProfileDialogViewPage.qml +++ b/storybook/pages/ProfileDialogViewPage.qml @@ -93,17 +93,6 @@ SplitView { incomingVerificationStatus: ctrlIncomingVerificationStatus.currentValue, contactRequestState: ctrlContactRequestState.currentValue, bio: bio.text, - socialLinks: JSON.stringify - ([{ - text: "__twitter", - url: "https://twitter.com/ethstatus", - icon: "twitter" - }, - { - text: "__github", - url: "https://github.com/status-im", - icon: "github" - }]), onlineStatus: ctrlOnlineStatus.currentValue }) } @@ -639,11 +628,20 @@ SplitView { Layout.fillWidth: true id: bio selectByMouse: true - text: "Hi, I am Alex. I'm an indie developer who mainly works on web products. + text: " + + +Hi, I am Alex. I'm an indie developer who mainly works on web products. + + I worked for several different companies and created a couple of my own products from scratch. Currently building Telescope and Prepacked. -Say hi, or find me on Twitter, GitHub, or Mastodon." +Say hi, or find me on Twitter, GitHub, or Mastodon. + + + +" } } } diff --git a/ui/imports/shared/views/ProfileDialogView.qml b/ui/imports/shared/views/ProfileDialogView.qml index 10cbae9f5e..a93ee6807a 100644 --- a/ui/imports/shared/views/ProfileDialogView.qml +++ b/ui/imports/shared/views/ProfileDialogView.qml @@ -464,6 +464,7 @@ Pane { enabled: d.contactDetails.trustStatus === Constants.trustStatus.untrustworthy && !d.isBlocked onTriggered: { root.contactsStore.removeTrustStatus(root.publicKey) + d.reload() } } StatusAction { @@ -556,12 +557,21 @@ Pane { } } } - StatusBaseText { + StatusScrollView { + id: bioScrollView Layout.fillWidth: true + Layout.preferredHeight: 116 + contentWidth: availableWidth Layout.topMargin: Style.current.halfPadding - wrapMode: Text.WrapAtWordBoundaryOrAnywhere - text: root.dirty ? root.dirtyValues.bio : d.contactDetails.bio - visible: !!text + padding: 0 + rightPadding: Style.current.padding + visible: !!bioText.text + StatusBaseText { + id: bioText + width: bioScrollView.availableWidth + wrapMode: Text.WrapAtWordBoundaryOrAnywhere + text: root.dirty ? root.dirtyValues.bio.trim() : d.contactDetails.bio.trim() + } } EmojiHash { Layout.topMargin: Style.current.halfPadding