feat(settings/profile): add bio and social links to profile view

closes: #6797
This commit is contained in:
Patryk Osmaczko 2022-08-10 10:36:14 +02:00 committed by osmaczko
parent 7adfb515a9
commit 88ad09f7c2
2 changed files with 22 additions and 0 deletions

View File

@ -31,6 +31,8 @@ StatusModal {
property string userNickname: "" property string userNickname: ""
property string userEnsName: "" property string userEnsName: ""
property string userIcon: "" property string userIcon: ""
property string userBio: ""
property string userSocialLinks: ""
property int userTrustStatus: Constants.trustStatus.unknown property int userTrustStatus: Constants.trustStatus.unknown
property int outgoingVerificationStatus: Constants.verificationStatus.unverified property int outgoingVerificationStatus: Constants.verificationStatus.unverified
property int incomingVerificationStatus: Constants.verificationStatus.unverified property int incomingVerificationStatus: Constants.verificationStatus.unverified
@ -73,12 +75,15 @@ StatusModal {
function openPopup(publicKey, state = "") { function openPopup(publicKey, state = "") {
// All this should be improved more, but for now we leave it like this. // All this should be improved more, but for now we leave it like this.
const contactDetails = Utils.getContactDetailsAsJson(publicKey); const contactDetails = Utils.getContactDetailsAsJson(publicKey);
userPublicKey = publicKey; userPublicKey = publicKey;
userDisplayName = contactDetails.displayName; userDisplayName = contactDetails.displayName;
userName = contactDetails.alias; userName = contactDetails.alias;
userNickname = contactDetails.localNickname; userNickname = contactDetails.localNickname;
userEnsName = contactDetails.name; userEnsName = contactDetails.name;
userIcon = contactDetails.largeImage; userIcon = contactDetails.largeImage;
userBio = contactDetails.bio;
userSocialLinks = contactDetails.socialLinks;
userIsEnsVerified = contactDetails.ensVerified; userIsEnsVerified = contactDetails.ensVerified;
userIsBlocked = contactDetails.isBlocked; userIsBlocked = contactDetails.isBlocked;
isAddedContact = contactDetails.isAdded; isAddedContact = contactDetails.isAdded;
@ -193,12 +198,15 @@ StatusModal {
profileStore: popup.profileStore profileStore: popup.profileStore
contactsStore: popup.contactsStore contactsStore: popup.contactsStore
userPublicKey: popup.userPublicKey userPublicKey: popup.userPublicKey
userDisplayName: popup.userDisplayName userDisplayName: popup.userDisplayName
userName: popup.userName userName: popup.userName
userNickname: popup.userNickname userNickname: popup.userNickname
userEnsName: popup.userEnsName userEnsName: popup.userEnsName
userIcon: popup.userIcon userIcon: popup.userIcon
userBio: popup.userBio
userSocialLinks: popup.userSocialLinks
userIsEnsVerified: popup.userIsEnsVerified userIsEnsVerified: popup.userIsEnsVerified
userIsBlocked: popup.userIsBlocked userIsBlocked: popup.userIsBlocked
isAddedContact: popup.isAddedContact isAddedContact: popup.isAddedContact

View File

@ -17,6 +17,8 @@ import StatusQ.Components 0.1
import StatusQ.Controls 0.1 import StatusQ.Controls 0.1
import StatusQ.Popups 0.1 import StatusQ.Popups 0.1
import "../panels"
Rectangle { Rectangle {
id: root id: root
@ -25,12 +27,15 @@ Rectangle {
property var profileStore property var profileStore
property var contactsStore property var contactsStore
property string userPublicKey: profileStore.pubkey property string userPublicKey: profileStore.pubkey
property string userDisplayName: profileStore.displayName property string userDisplayName: profileStore.displayName
property string userName: profileStore.username property string userName: profileStore.username
property string userNickname: profileStore.details.localNickname property string userNickname: profileStore.details.localNickname
property string userEnsName: profileStore.ensName property string userEnsName: profileStore.ensName
property string userIcon: profileStore.profileLargeImage property string userIcon: profileStore.profileLargeImage
property string userBio: profileStore.bio
property string userSocialLinks: profileStore.socialLinksJson
property string text: "" property string text: ""
property bool userIsEnsVerified: profileStore.details.ensVerified property bool userIsEnsVerified: profileStore.details.ensVerified
@ -190,6 +195,15 @@ Rectangle {
statusText: qsTr("Blocked") statusText: qsTr("Blocked")
} }
ProfileBioSocialsPanel {
Layout.fillWidth: true
Layout.leftMargin: 16
Layout.rightMargin: 16
bio: root.userBio
userSocialLinksJson: root.userSocialLinks
}
StatusDescriptionListItem { StatusDescriptionListItem {
Layout.fillWidth: true Layout.fillWidth: true
visible: !showVerifyIdentitySection && !showVerificationPendingSection && !showIdentityVerified visible: !showVerifyIdentitySection && !showVerificationPendingSection && !showIdentityVerified