feat(@settings): Add network list

This commit is contained in:
Anthony Laibe 2022-03-02 13:54:58 +01:00 committed by Iuri Matias
parent 35e50d186b
commit 27d476ac02
5 changed files with 118 additions and 46 deletions

View File

@ -64,7 +64,6 @@ StatusAppTwoPanelLayout {
WalletView { WalletView {
id: walletView id: walletView
walletStore: profileView.store.walletStore walletStore: profileView.store.walletStore
profileContentWidth: _internal.profileContentWidth
} }
PrivacyView { PrivacyView {

View File

@ -0,0 +1,20 @@
import StatusQ.Components 0.1
import StatusQ.Core 0.1
StatusListItem {
property var network
title: network.chainName
icon.isLetterIdenticon: true
width: parent.width
leftPadding: 0
rightPadding: 0
components: [
StatusIcon {
icon: "chevron-down"
rotation: 270
color: Theme.palette.baseColor1
}
]
}

View File

@ -18,10 +18,7 @@ import "./wallet"
ScrollView { ScrollView {
id: root id: root
property int profileContentWidth anchors.fill: parent
height: parent.height
width: parent.width
contentHeight: advancedContainer.height + 100 contentHeight: advancedContainer.height + 100
clip: true clip: true
@ -29,15 +26,14 @@ ScrollView {
Item { Item {
id: advancedContainer id: advancedContainer
width: profileContentWidth anchors.top: parent.top
anchors.horizontalCenter: parent.horizontalCenter anchors.left: parent.left
height: stackContainer.height
StackLayout { StackLayout {
id: stackContainer id: stackContainer
anchors.fill: parent anchors.fill: parent
currentIndex: 0 currentIndex: 0
onCurrentIndexChanged: { onCurrentIndexChanged: {
@ -48,6 +44,12 @@ ScrollView {
MainView { MainView {
walletStore: root.walletStore walletStore: root.walletStore
anchors.topMargin: 64
anchors.top: parent.top
anchors.leftMargin: 64
anchors.left: parent.left
width: 560
onGoToNetworksView: { onGoToNetworksView: {
stackContainer.currentIndex = 1 stackContainer.currentIndex = 1
} }

View File

@ -12,10 +12,6 @@ import "../../controls"
Column { Column {
id: root id: root
anchors.top: parent.top
anchors.topMargin: 64
anchors.left: parent.left
anchors.right: parent.right
property WalletStore walletStore property WalletStore walletStore

View File

@ -1,48 +1,103 @@
import QtQuick 2.13 import QtQuick 2.13
import shared.status 1.0 import shared.status 1.0
import StatusQ.Controls 0.1
import "../../stores" import StatusQ.Core 0.1
import StatusQ.Core.Theme 0.1
import utils 1.0 import utils 1.0
Column { import "../../stores"
import "../../controls"
Item {
id: root id: root
anchors.top: parent.top signal goBack
anchors.topMargin: 64
anchors.left: parent.left
anchors.right: parent.right
property WalletStore walletStore property WalletStore walletStore
signal goBack StatusFlatButton {
id: backButton
ListView { anchors.top: parent.top
id: layer1List anchors.topMargin: Style.current.bigPadding
model: walletStore.layer1Networks anchors.left: parent.left
width: parent.width anchors.leftMargin: Style.current.bigPadding
height: layer1List.childrenRect.height icon.name: "arrow-left"
delegate: StatusSettingsLineButton { icon.height: 13.5
text: model.chainName icon.width: 17.5
text: qsTr("Wallet")
onClicked: {
root.goBack()
} }
} }
ListView { Column {
id: layer2List id: column
model: walletStore.layer2Networks anchors.topMargin: Style.current.xlPadding
width: parent.width anchors.top: backButton.bottom
height: layer2List.childrenRect.height anchors.leftMargin: Style.current.xlPadding * 2
delegate: StatusSettingsLineButton { anchors.left: root.left
text: model.chainName width: 560
}
}
ListView { Row {
id: testList spacing: 250
model: walletStore.testNetworks StatusBaseText {
width: parent.width id: titleText
height: testList.childrenRect.height text: qsTr("Networks")
delegate: StatusSettingsLineButton { font.weight: Font.Bold
text: model.chainName font.pixelSize: 28
color: Theme.palette.directColor1
}
StatusButton {
id: addCustomNetworkButton
type: StatusFlatRoundButton.Type.Primary
text: qsTr("Add Custom Network")
onClicked: {
root.goBack()
}
}
}
Item {
height: Style.current.bigPadding
width: parent.width
}
Repeater {
id: layer1List
model: walletStore.layer1Networks
delegate: WalletNetworkDelegate {
network: model
}
}
StatusSectionHeadline {
text: qsTr("Layer 2")
topPadding: Style.current.bigPadding
bottomPadding: Style.current.padding
}
Repeater {
id: layer2List
model: walletStore.layer2Networks
delegate: WalletNetworkDelegate {
network: model
}
}
StatusSectionHeadline {
text: qsTr("Testnets")
topPadding: Style.current.bigPadding
bottomPadding: Style.current.padding
}
Repeater {
id: testList
model: walletStore.testNetworks
delegate: WalletNetworkDelegate {
network: model
}
} }
} }
} }