refactor(InvitationBubble): make use of StatusQ components

This commit is contained in:
Pascal Precht 2021-10-18 14:32:48 +02:00 committed by Iuri Matias
parent 2d89a815f4
commit 0739f78388

View File

@ -1,13 +1,15 @@
import QtQuick 2.3 import QtQuick 2.3
import QtQuick.Dialogs 1.3 import QtQuick.Dialogs 1.3
import "../../../../shared"
import "../../../../shared/popups"
import "../../../../shared/panels"
import "../../../../shared/status"
import utils 1.0 import utils 1.0
import StatusQ.Core 0.1
import StatusQ.Core.Theme 0.1
import StatusQ.Controls 0.1
import "../../../../shared/panels"
import "../../../../shared/popups"
Item { Item {
property string communityId property string communityId
property var invitedCommunity property var invitedCommunity
@ -179,9 +181,9 @@ Item {
} }
// TODO add check if verified // TODO add check if verified
StyledText { StatusBaseText {
id: title id: title
color: invitedCommunity.verifed ? Style.current.primary : Style.current.secondaryText color: invitedCommunity.verifed ? Theme.palette.primaryColor1 : Theme.palette.baseColor1
text: invitedCommunity.verifed ? text: invitedCommunity.verifed ?
//% "Verified community invitation" //% "Verified community invitation"
qsTrId("verified-community-invitation") : qsTrId("verified-community-invitation") :
@ -195,7 +197,7 @@ Item {
font.pixelSize: 13 font.pixelSize: 13
} }
StyledText { StatusBaseText {
id: invitedYou id: invitedYou
text: { text: {
if (chatsModel.channelView.activeChannel.chatType === Constants.chatTypeOneToOne) { if (chatsModel.channelView.activeChannel.chatType === Constants.chatTypeOneToOne) {
@ -220,6 +222,7 @@ Item {
anchors.rightMargin: root.innerMargin anchors.rightMargin: root.innerMargin
wrapMode: Text.WordWrap wrapMode: Text.WordWrap
font.pixelSize: 15 font.pixelSize: 15
color: Theme.palette.directColor1
} }
Separator { Separator {
@ -229,7 +232,7 @@ Item {
} }
// TODO add image when it's supported // TODO add image when it's supported
StyledText { StatusBaseText {
id: communityName id: communityName
text: invitedCommunity.name text: invitedCommunity.name
anchors.top: sep1.bottom anchors.top: sep1.bottom
@ -241,9 +244,10 @@ Item {
font.weight: Font.Bold font.weight: Font.Bold
wrapMode: Text.WrapAtWordBoundaryOrAnywhere wrapMode: Text.WrapAtWordBoundaryOrAnywhere
font.pixelSize: 17 font.pixelSize: 17
color: Theme.palette.directColor1
} }
StyledText { StatusBaseText {
id: communityDesc id: communityDesc
text: invitedCommunity.description text: invitedCommunity.description
anchors.top: communityName.bottom anchors.top: communityName.bottom
@ -254,9 +258,10 @@ Item {
anchors.rightMargin: root.innerMargin anchors.rightMargin: root.innerMargin
wrapMode: Text.WrapAtWordBoundaryOrAnywhere wrapMode: Text.WrapAtWordBoundaryOrAnywhere
font.pixelSize: 15 font.pixelSize: 15
color: Theme.palette.directColor1
} }
StyledText { StatusBaseText {
id: communityNbMembers id: communityNbMembers
// TODO add the plural support // TODO add the plural support
//% "%1 members" //% "%1 members"
@ -267,7 +272,7 @@ Item {
anchors.leftMargin: root.innerMargin anchors.leftMargin: root.innerMargin
font.pixelSize: 13 font.pixelSize: 13
font.weight: Font.Medium font.weight: Font.Medium
color: Style.current.secondaryText color: Theme.palette.baseColor1
} }
Separator { Separator {
@ -281,12 +286,11 @@ Item {
height: 44 height: 44
anchors.bottom: parent.bottom anchors.bottom: parent.bottom
clip: true clip: true
StatusButton { StatusFlatButton {
id: joinBtn id: joinBtn
type: "secondary"
anchors.top: parent.top anchors.top: parent.top
anchors.topMargin: -Style.current.smallPadding anchors.topMargin: -Style.current.smallPadding
borderRadius: 16 radius: 16
width: parent.width width: parent.width
height: 54 height: 54
enabled: true enabled: true