chore: extract join.status link prefixes to Constants

This commit is contained in:
Jonathan Rainville 2021-03-09 12:59:41 -05:00 committed by Iuri Matias
parent 62d10eba49
commit f3b452188a
4 changed files with 9 additions and 7 deletions

View File

@ -11,6 +11,7 @@ import "../components"
ModalPopup {
id: popup
property string communityId: chatsModel.communities.activeCommunity.id
property var pubKeys: []
property var goBack
@ -36,8 +37,8 @@ ModalPopup {
anchors.top: parent.top
//% "Share community"
label: qsTrId("share-community")
text: "https://join.status.im/u/TODO"
textToCopy: text
text: `${Constants.communityLinkPrefix}${communityId.substring(0, 4)}...${communityId.substring(communityId.length -2)}`
textToCopy: Constants.communityLinkPrefix + communityId
}
Separator {

View File

@ -187,11 +187,10 @@ ModalPopup {
id: valueShareURL
//% "Share Profile URL"
label: qsTrId("share-profile-url")
text: "https://join.status.im/u/" + fromAuthor.substr(
0, 4) + "..." + fromAuthor.substr(fromAuthor.length - 5)
text: Constants.userLinkPrefix + fromAuthor.substr(0, 4) + "..." + fromAuthor.substr(fromAuthor.length - 5)
anchors.top: separator.top
anchors.topMargin: popup.innerMargin
textToCopy: "https://join.status.im/u/" + fromAuthor
textToCopy: Constants.userLinkPrefix + fromAuthor
}
Separator {

View File

@ -146,8 +146,8 @@ Item {
TextWithLabel {
//% "Share Profile URL"
label: qsTrId("share-profile-url")
text: `https://join.status.im/u/${pubkey.substring(0, 5)}...${pubkey.substring(pubkey.length - 5)}`
textToCopy: `https://join.status.im/u/${pubkey}`
text: `${Constants.userLinkPrefix}${pubkey.substring(0, 5)}...${pubkey.substring(pubkey.length - 5)}`
textToCopy: Constants.userLinkPrefix + pubkey
}
}
}

View File

@ -117,6 +117,8 @@ QtObject {
readonly property string deepLinkPrefix: 'statusim://'
readonly property string joinStatusLink: 'join.status.im'
readonly property string communityLinkPrefix: 'https://join.status.im/cc/'
readonly property string userLinkPrefix: 'https://join.status.im/u/'
readonly property int maxUploadFiles: 5
readonly property double maxUploadFilesizeMB: 0.5