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
This commit is contained in:
Lukáš Tinkl 2024-04-19 00:02:13 +02:00 committed by Lukáš Tinkl
parent 6930cc49a7
commit eae2489254
2 changed files with 25 additions and 17 deletions

View File

@ -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.
"
}
}
}

View File

@ -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
padding: 0
rightPadding: Style.current.padding
visible: !!bioText.text
StatusBaseText {
id: bioText
width: bioScrollView.availableWidth
wrapMode: Text.WrapAtWordBoundaryOrAnywhere
text: root.dirty ? root.dirtyValues.bio : d.contactDetails.bio
visible: !!text
text: root.dirty ? root.dirtyValues.bio.trim() : d.contactDetails.bio.trim()
}
}
EmojiHash {
Layout.topMargin: Style.current.halfPadding