2022-03-25 09:09:49 +00:00
|
|
|
import QtQuick 2.14
|
2022-05-28 19:38:21 +00:00
|
|
|
import QtWebEngine 1.10
|
2022-03-25 09:09:49 +00:00
|
|
|
import shared.status 1.0
|
|
|
|
import StatusQ.Controls 0.1
|
|
|
|
import StatusQ.Core 0.1
|
|
|
|
import StatusQ.Core.Theme 0.1
|
|
|
|
import StatusQ.Components 0.1
|
|
|
|
import utils 1.0
|
|
|
|
|
2022-10-25 13:57:04 +00:00
|
|
|
import AppLayouts.Profile.stores 1.0
|
2022-03-25 09:09:49 +00:00
|
|
|
|
|
|
|
Column {
|
|
|
|
id: root
|
|
|
|
|
|
|
|
property WalletStore walletStore
|
|
|
|
|
|
|
|
Repeater {
|
|
|
|
id: permissionsList
|
|
|
|
model: walletStore.dappList
|
|
|
|
delegate: Item {
|
2022-10-25 13:57:04 +00:00
|
|
|
property string dappName: model.name
|
2022-03-25 09:09:49 +00:00
|
|
|
width: parent.width
|
|
|
|
height: listItem.height + spacer.height
|
2022-05-28 19:38:21 +00:00
|
|
|
WebEngineView {
|
|
|
|
id: webView
|
2022-10-25 13:57:04 +00:00
|
|
|
url: dappName.startsWith("http") ? dappName : `http://${dappName}`
|
2022-05-28 19:38:21 +00:00
|
|
|
visible: false
|
|
|
|
}
|
2022-03-25 09:09:49 +00:00
|
|
|
StatusListItem {
|
|
|
|
id: listItem
|
2022-10-25 13:57:04 +00:00
|
|
|
title: webView.title !== "" ? webView.title : dappName
|
|
|
|
subTitle: dappName
|
|
|
|
asset.name: webView.icon != "" ? webView.icon : Style.svg("compassActive")
|
2022-08-11 11:55:08 +00:00
|
|
|
asset.isImage: true
|
2022-03-25 09:09:49 +00:00
|
|
|
width: parent.width
|
|
|
|
highlighted: true
|
|
|
|
sensor.enabled: false
|
|
|
|
components: [
|
|
|
|
StatusButton {
|
|
|
|
text: model.accounts.count > 1 ? qsTr("Disconnect All") : qsTr("Disconnect")
|
|
|
|
size: StatusBaseButton.Size.Small
|
|
|
|
type: StatusBaseButton.Type.Danger
|
|
|
|
onClicked: {
|
2022-10-25 13:57:04 +00:00
|
|
|
walletStore.disconnect(dappName)
|
2022-03-25 09:09:49 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
]
|
|
|
|
bottomModel: model.accounts
|
|
|
|
bottomDelegate: StatusListItemTag {
|
2022-10-25 13:57:04 +00:00
|
|
|
property int outerIndex: listItem.index || 0
|
2022-03-25 09:09:49 +00:00
|
|
|
|
|
|
|
title: model.name
|
2022-05-28 19:38:21 +00:00
|
|
|
|
2022-08-11 11:55:08 +00:00
|
|
|
asset.emoji: !!model.emoji ? model.emoji: ""
|
|
|
|
asset.color: model.color
|
|
|
|
asset.name: !model.emoji ? "filled-account": ""
|
|
|
|
asset.letterSize: 14
|
|
|
|
asset.isLetterIdenticon: !!model.emoji
|
|
|
|
asset.bgColor: Theme.palette.indirectColor1
|
2022-03-25 09:09:49 +00:00
|
|
|
onClicked: {
|
|
|
|
walletStore.disconnectAddress(dappName, model.address)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
Item {
|
|
|
|
id: spacer
|
|
|
|
height: Style.current.bigPadding
|
|
|
|
width: parent.width
|
|
|
|
}
|
|
|
|
} // Item
|
|
|
|
} // Repeater
|
|
|
|
} // Column
|