fix(JoinCommunityView): Change Reveal Address button icon based on auth type

This commit is contained in:
Alex Jbanca 2023-03-30 12:42:28 +03:00 committed by Alex Jbanca
parent b72fff3f04
commit 5dc60f5782
6 changed files with 46 additions and 0 deletions

View File

@ -41,6 +41,7 @@ Nemo enim 😋 ipsam voluptatem quia voluptas sit aspernatur aut odit aut fugit,
property bool isInvitationPending: true
property bool isJoinRequestRejected: false
property bool requiresRequest: false
property int loginType: Constants.LoginType.Biometrics
property var communityHoldingsModel: PermissionsModel.shortPermissionsModel
property var viewOnlyHoldingsModel: PermissionsModel.shortPermissionsModel
@ -116,6 +117,7 @@ Nemo enim 😋 ipsam voluptatem quia voluptas sit aspernatur aut odit aut fugit,
joinCommunity: d.joinCommunity
accessType: d.accessType
isInvitationPending: d.isInvitationPending
loginType: d.loginType
// Blur background properties:
membersCount: d.membersCount
@ -280,6 +282,21 @@ Nemo enim 😋 ipsam voluptatem quia voluptas sit aspernatur aut odit aut fugit,
onViewAndPostHoldingsModelChanged: d.viewAndPostHoldingsModel = viewAndPostHoldingsModel
onModerateHoldingsModelChanged: d.moderateHoldingsModel = moderateHoldingsModel
}
ColumnLayout {
Label {
Layout.fillWidth: true
text: "Login type"
}
ComboBox {
id: loginTypeComboBox
Layout.fillWidth: true
model: ["Password","Biometrics","Keycard"]
onActivated: d.loginType = currentIndex
Component.onCompleted: currentIndex = d.loginType
}
}
}
}
}

View File

@ -72,6 +72,7 @@ StackLayout {
notificationCount: activityCenterStore.unreadNotificationsCount
hasUnseenNotifications: activityCenterStore.hasUnseenNotifications
openCreateChat: rootStore.openCreateChat
loginType: root.rootStore.loginType
onNotificationButtonClicked: Global.openActivityCenterPopup()
onAdHocChatButtonClicked: rootStore.openCloseCreateChatView()
onRevealAddressClicked: {

View File

@ -11,6 +11,7 @@ import AppLayouts.Chat.helpers 1.0
import AppLayouts.Chat.controls.community 1.0
import SortFilterProxyModel 0.2
import utils 1.0
Control {
@ -28,6 +29,7 @@ Control {
property var viewAndPostHoldingsModel
property var moderateHoldingsModel
property bool showOnlyPanels: false
property int loginType: Constants.LoginType.Password
property var assetsModel
property var collectiblesModel
@ -58,6 +60,11 @@ Control {
function getRevealAddressText() {
return root.joinCommunity ? (root.requiresRequest ? d.communityRevealAddressWithRequestText : d.communityRevealAddressText) : d.channelRevealAddressText
}
function getRevealAddressIcon() {
if(root.loginType == Constants.LoginType.Password) return "password"
return root.loginType == Constants.LoginType.Biometrics ? "touch-id" : "keycard"
}
}
padding: 35 // default by design
@ -106,6 +113,7 @@ Control {
Layout.alignment: Qt.AlignHCenter
visible: !root.showOnlyPanels && !root.isJoinRequestRejected
text: root.isInvitationPending ? d.getInvitationPendingText() : d.getRevealAddressText()
icon.name: root.isInvitationPending ? "" : d.getRevealAddressIcon()
font.pixelSize: 13
enabled: root.requirementsMet
onClicked: root.isInvitationPending ? root.invitationPendingClicked() : root.revealAddressClicked()

View File

@ -234,6 +234,8 @@ QtObject {
property bool isDebugEnabled: advancedModule ? advancedModule.isDebugEnabled : false
readonly property int loginType: getLoginType()
property var stickersStore: StickersStore {
stickersModule: stickersModuleInst
}
@ -656,6 +658,17 @@ QtObject {
return globalUtilsInst.hex2Eth(value)
}
function getLoginType() {
if(!userProfileInst)
return Constants.LoginType.Password
if(userProfileInst.usingBiometricLogin)
return Constants.LoginType.Biometrics
else if(userProfileInst.isKeycardUser)
return Constants.LoginType.Keycard
else return Constants.LoginType.Password
}
readonly property Connections communitiesModuleConnections: Connections {
target: communitiesModuleInst
function onImportingCommunityStateChanged(communityId, state, errorMsg) {

View File

@ -36,6 +36,7 @@ StatusSectionLayout {
property bool requirementsMet: true
property bool isJoinRequestRejected: false
property bool requiresRequest: false
property alias loginType: overlayPannel.loginType
property var communityHoldingsModel
property var viewOnlyHoldingsModel

View File

@ -858,6 +858,12 @@ QtObject {
NoError
}
enum LoginType {
Password,
Biometrics,
Keycard
}
readonly property QtObject walletSection: QtObject {
readonly property string cancelledMessage: "cancelled"