feat: add invite friends modal

This commit is contained in:
Jonathan Rainville 2020-07-09 11:21:45 -04:00 committed by Iuri Matias
parent ff2ed712f2
commit b3b7047fe1
6 changed files with 46 additions and 2 deletions

View File

@ -3,6 +3,7 @@ import QtQuick.Controls 2.13
import QtQuick.Layouts 1.13
import "../../../../shared"
import "../../../../imports"
import "../components"
Item {
id: element
@ -17,7 +18,10 @@ Item {
}
StyledText {
text: `<a href="shareKey" style="color:${Style.current.blue};text-decoration:none;">Share your chat key</a> or <a href="invite" style="color:${Style.current.blue};text-decoration:none">invite</a> friends to start messaging in Status`
text: `<a href="shareKey" style="color:${Style.current.blue};text-decoration:none;">${qsTr("Share your chat key")}</a>` +
` ${qsTr("or")} ` +
`<a href="invite" style="color:${Style.current.blue};text-decoration:none">${qsTr("invite")}</a>`+
` ${qsTr("friends to start messaging in Status")}`
textFormat: Text.RichText
wrapMode: Text.WordWrap
horizontalAlignment: Text.AlignHCenter
@ -29,11 +33,15 @@ Item {
onLinkActivated: function (linkClicked) {
switch (linkClicked) {
case "shareKey": console.log('Go to share key'); break;
case "invite": console.log('Go to invite'); break;
case "invite": inviteFriendsPopup.open(); break;
default: //no idea what was clicked
}
}
}
InviteFriendsPopup {
id: inviteFriendsPopup
}
}
/*##^##
Designer {

View File

@ -84,6 +84,13 @@ Item {
anchors.horizontalCenter: parent.horizontalCenter
anchors.bottom: parent.bottom
anchors.bottomMargin: Style.current.xlPadding
onClicked: {
inviteFriendsPopup.open()
}
}
InviteFriendsPopup {
id: inviteFriendsPopup
}
}

View File

@ -0,0 +1,25 @@
import QtQuick 2.12
import QtQuick.Controls 2.3
import "../../../../imports"
import "../../../../shared"
ModalPopup {
id: popup
readonly property string getStatusText: qsTr("Get Status at https://status.im")
title: qsTr("Download Status link")
height: 156
StyledText {
id: linkText
text: popup.getStatusText
}
CopyToClipBoardButton {
anchors.left: linkText.right
anchors.leftMargin: Style.current.smallPadding
anchors.verticalCenter: linkText.verticalCenter
textToCopy: popup.getStatusText
}
}

View File

@ -7,3 +7,4 @@ ChannelIcon 1.0 ChannelIcon.qml
RenameGroupPopup 1.0 RenameGroupPopup.qml
GroupChatPopup 1.0 GroupChatPopup.qml
StickersPopup 1.0 StickersPopup.qml
InviteFriendsPopup 1.0 InviteFriendsPopup.qml

View File

@ -57,6 +57,7 @@ else: unix:!android: target.path = /opt/$${TARGET}/bin
DISTFILES += \
app/AppLayouts/Chat/ContactsColumn/ClosedEmptyView.qml \
app/AppLayouts/Chat/components/EmojiPopup.qml \
app/AppLayouts/Chat/components/InviteFriendsPopup.qml \
fonts/InterStatus/InterStatus-Black.otf \
fonts/InterStatus/InterStatus-BlackItalic.otf \
fonts/InterStatus/InterStatus-Bold.otf \

View File

@ -110,12 +110,14 @@ Popup {
Separator {
id: separator2
visible: !!footerContent.children[0]
anchors.bottom: parent.bottom
anchors.bottomMargin: 75
}
Item {
id: footerContent
visible: !!children[0]
height: children[0] && children[0].height
width: parent.width
anchors.top: separator2.bottom