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

View File

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

View File

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

View File

@ -117,6 +117,8 @@ QtObject {
readonly property string deepLinkPrefix: 'statusim://' readonly property string deepLinkPrefix: 'statusim://'
readonly property string joinStatusLink: 'join.status.im' 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 int maxUploadFiles: 5
readonly property double maxUploadFilesizeMB: 0.5 readonly property double maxUploadFilesizeMB: 0.5