mirror of
https://github.com/status-im/status-desktop.git
synced 2025-01-22 20:40:18 +00:00
refactor(ContactsContainer): make use of NoFriendsRectangle
This commit is contained in:
parent
1b009d634d
commit
105c4cba4a
@ -6,16 +6,17 @@ import "../../../../shared/status"
|
||||
Rectangle {
|
||||
id: noContactsRect
|
||||
width: 260
|
||||
property string text: qsTr("You don’t have any contacts yet. Invite your friends to start chatting.")
|
||||
StyledText {
|
||||
id: noContacts
|
||||
//% "You don’t have any contacts yet. Invite your friends to start chatting."
|
||||
text: qsTrId("you-don-t-have-any-contacts-yet--invite-your-friends-to-start-chatting-")
|
||||
text: noContactsRect.text
|
||||
color: Style.current.darkGrey
|
||||
anchors.top: parent.top
|
||||
anchors.topMargin: Style.current.padding
|
||||
anchors.left: parent.left
|
||||
anchors.right: parent.right
|
||||
wrapMode: Text.WordWrap
|
||||
font.pixelSize: 15
|
||||
horizontalAlignment: Text.AlignHCenter
|
||||
}
|
||||
StatusButton {
|
||||
|
@ -149,35 +149,13 @@ ModalPopup {
|
||||
}
|
||||
}
|
||||
|
||||
Rectangle {
|
||||
|
||||
NoFriendsRectangle {
|
||||
id: noContactsRect
|
||||
width: 260
|
||||
anchors.centerIn: parent
|
||||
StyledText {
|
||||
id: noContacts
|
||||
//% "You don’t have any contacts yet. Invite your friends to start chatting."
|
||||
text: qsTrId("you-don-t-have-any-contacts-yet--invite-your-friends-to-start-chatting-")
|
||||
color: Style.current.darkGrey
|
||||
anchors.top: parent.top
|
||||
anchors.topMargin: Style.current.padding
|
||||
anchors.left: parent.left
|
||||
anchors.right: parent.right
|
||||
wrapMode: Text.WordWrap
|
||||
horizontalAlignment: Text.AlignHCenter
|
||||
}
|
||||
StatusButton {
|
||||
//% "Invite friends"
|
||||
text: qsTrId("invite-friends")
|
||||
anchors.horizontalCenter: parent.horizontalCenter
|
||||
anchors.top: noContacts.bottom
|
||||
anchors.topMargin: Style.current.xlPadding
|
||||
onClicked: {
|
||||
inviteFriendsPopup.open()
|
||||
}
|
||||
}
|
||||
InviteFriendsPopup {
|
||||
id: inviteFriendsPopup
|
||||
}
|
||||
visible: profileModel.contacts.addedContacts.rowCount() === 0
|
||||
text: qsTr("You don’t have any contacts yet. Invite your friends to start chatting.")
|
||||
width: parent.width
|
||||
anchors.verticalCenter: parent.verticalCenter
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -232,37 +232,12 @@ Item {
|
||||
searchString: searchBox.text
|
||||
}
|
||||
|
||||
Item {
|
||||
NoFriendsRectangle {
|
||||
id: element
|
||||
visible: profileModel.contacts.addedContacts.rowCount() === 0
|
||||
anchors.top: addNewContact.bottom
|
||||
text: qsTr("You don’t have any contacts yet")
|
||||
width: parent.width
|
||||
anchors.bottom: parent.bottom
|
||||
|
||||
StyledText {
|
||||
id: noFriendsText
|
||||
//% "You don’t have any contacts yet"
|
||||
text: qsTrId("you-don-t-have-any-contacts-yet")
|
||||
anchors.verticalCenterOffset: -Style.current.bigPadding
|
||||
anchors.horizontalCenter: parent.horizontalCenter
|
||||
anchors.verticalCenter: parent.verticalCenter
|
||||
font.pixelSize: 15
|
||||
color: Style.current.darkGrey
|
||||
}
|
||||
|
||||
StatusButton {
|
||||
anchors.horizontalCenter: noFriendsText.horizontalCenter
|
||||
anchors.top: noFriendsText.bottom
|
||||
anchors.topMargin: Style.current.bigPadding
|
||||
//% "Invite friends"
|
||||
text: qsTrId("invite-friends")
|
||||
onClicked: function () {
|
||||
inviteFriendsPopup.open()
|
||||
}
|
||||
}
|
||||
}
|
||||
InviteFriendsPopup {
|
||||
id: inviteFriendsPopup
|
||||
anchors.verticalCenter: parent.verticalCenter
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user