chores(@wallet): remove wallet 2
This commit is contained in:
parent
713e6685ca
commit
626541e3bd
|
@ -6,10 +6,6 @@ const WALLET_SECTION_ID* = "wallet"
|
|||
const WALLET_SECTION_NAME* = "Wallet"
|
||||
const WALLET_SECTION_ICON* = "wallet"
|
||||
|
||||
const WALLETV2_SECTION_ID* = "walletV2"
|
||||
const WALLETV2_SECTION_NAME* = "WalletV2"
|
||||
const WALLETV2_SECTION_ICON* = "cancel"
|
||||
|
||||
const BROWSER_SECTION_ID* = "browser"
|
||||
const BROWSER_SECTION_NAME* = "Browser"
|
||||
const BROWSER_SECTION_ICON* = "browser"
|
||||
|
|
|
@ -10,8 +10,6 @@ const LSS_KEY_COMMUNITIES_ENABLED* = "communitiesEnabled"
|
|||
const DEFAULT_COMMUNITIES_ENABLED = false
|
||||
const LSS_KEY_IS_WALLET_ENABLED* = "isWalletEnabled"
|
||||
const DEFAULT_IS_WALLET_ENABLED = false
|
||||
const LSS_KEY_IS_WALLET_V2_ENABLED* = "isWalletV2Enabled"
|
||||
const DEFAULT_IS_WALLET_V2_ENABLED = false
|
||||
const LSS_KEY_NODE_MANAGEMENT_ENABLED* = "nodeManagementEnabled"
|
||||
const DEFAULT_NODE_MANAGEMENT_ENABLED = false
|
||||
const LSS_KEY_IS_BROWSER_ENABLED* = "isBrowserEnabled"
|
||||
|
@ -226,20 +224,6 @@ QtObject:
|
|||
write = setIsWalletEnabled
|
||||
notify = isWalletEnabledChanged
|
||||
|
||||
|
||||
proc isWalletV2EnabledChanged*(self: LocalAccountSensitiveSettings) {.signal.}
|
||||
proc getIsWalletV2Enabled*(self: LocalAccountSensitiveSettings): bool {.slot.} =
|
||||
getSettingsProp[bool](self, LSS_KEY_IS_WALLET_V2_ENABLED, newQVariant(DEFAULT_IS_WALLET_V2_ENABLED))
|
||||
proc setIsWalletV2Enabled*(self: LocalAccountSensitiveSettings, value: bool) {.slot.} =
|
||||
setSettingsProp(self, LSS_KEY_IS_WALLET_V2_ENABLED, newQVariant(value)):
|
||||
self.isWalletV2EnabledChanged()
|
||||
|
||||
QtProperty[bool] isWalletV2Enabled:
|
||||
read = getIsWalletV2Enabled
|
||||
write = setIsWalletV2Enabled
|
||||
notify = isWalletV2EnabledChanged
|
||||
|
||||
|
||||
proc nodeManagementEnabledChanged*(self: LocalAccountSensitiveSettings) {.signal.}
|
||||
proc getNodeManagementEnabled*(self: LocalAccountSensitiveSettings): bool {.slot.} =
|
||||
getSettingsProp[bool](self, LSS_KEY_NODE_MANAGEMENT_ENABLED, newQVariant(DEFAULT_NODE_MANAGEMENT_ENABLED))
|
||||
|
@ -849,7 +833,6 @@ QtObject:
|
|||
of LSS_KEY_PROFILE_SPLIT_VIEW: self.profileSplitViewChanged()
|
||||
of LSS_KEY_COMMUNITIES_ENABLED: self.communitiesEnabledChanged()
|
||||
of LSS_KEY_IS_WALLET_ENABLED: self.isWalletEnabledChanged()
|
||||
of LSS_KEY_IS_WALLET_V2_ENABLED: self.isWalletV2EnabledChanged()
|
||||
of LSS_KEY_NODE_MANAGEMENT_ENABLED: self.nodeManagementEnabledChanged()
|
||||
of LSS_KEY_IS_BROWSER_ENABLED: self.isBrowserEnabledChanged()
|
||||
of LSS_KEY_IS_ACTIVITY_CENTER_ENABLED: self.isActivityCenterEnabledChanged()
|
||||
|
|
|
@ -291,21 +291,6 @@ method load*[T](
|
|||
if(activeSectionId == walletSectionItem.id):
|
||||
activeSection = walletSectionItem
|
||||
|
||||
# WalletV2 Section
|
||||
let walletV2SectionItem = initItem(conf.WALLETV2_SECTION_ID, SectionType.WalletV2, conf.WALLETV2_SECTION_NAME,
|
||||
amISectionAdmin = false,
|
||||
description = "",
|
||||
image = "",
|
||||
conf.WALLETV2_SECTION_ICON,
|
||||
color = "",
|
||||
hasNotification = false,
|
||||
notificationsCount = 0,
|
||||
active = false,
|
||||
enabled = singletonInstance.localAccountSensitiveSettings.getIsWalletV2Enabled())
|
||||
self.view.model().addItem(walletV2SectionItem)
|
||||
if(activeSectionId == walletV2SectionItem.id):
|
||||
activeSection = walletV2SectionItem
|
||||
|
||||
# Browser Section
|
||||
let browserSectionItem = initItem(conf.BROWSER_SECTION_ID, SectionType.Browser, conf.BROWSER_SECTION_NAME,
|
||||
amISectionAdmin = false,
|
||||
|
@ -357,7 +342,6 @@ method load*[T](
|
|||
self.chatSectionModule.load(events, settingsService, contactsService, chatService, communityService, messageService, gifService, mailserversService)
|
||||
for cModule in self.communitySectionsModule.values:
|
||||
cModule.load(events, settingsService, contactsService, chatService, communityService, messageService, gifService, mailserversService)
|
||||
# self.walletV2SectionModule.load()
|
||||
self.browserSectionModule.load()
|
||||
# self.nodeManagementSectionModule.load()
|
||||
self.profileSectionModule.load()
|
||||
|
|
|
@ -7,7 +7,6 @@ type
|
|||
Chat = 0
|
||||
Community,
|
||||
Wallet,
|
||||
WalletV2,
|
||||
Browser,
|
||||
ProfileSettings,
|
||||
NodeManagement
|
||||
|
|
|
@ -1,207 +0,0 @@
|
|||
import QtQuick 2.13
|
||||
import QtQuick.Controls 2.13
|
||||
import QtQuick.Layouts 1.13
|
||||
|
||||
import utils 1.0
|
||||
import shared 1.0
|
||||
import shared.controls 1.0
|
||||
|
||||
import "stores"
|
||||
import "controls"
|
||||
import "views"
|
||||
import "panels"
|
||||
import "popups"
|
||||
import "views/assets"
|
||||
import "views/collectibles"
|
||||
|
||||
import StatusQ.Controls 0.1
|
||||
import StatusQ.Layout 0.1
|
||||
import StatusQ.Popups 0.1
|
||||
|
||||
Item {
|
||||
id: walletView
|
||||
|
||||
property bool hideSignPhraseModal: false
|
||||
property RootStore store: RootStore { }
|
||||
|
||||
function showSigningPhrasePopup() {
|
||||
//TODO improve this to not use dynamic scoping
|
||||
if(!hideSignPhraseModal && !localAccountSensitiveSettings.hideSignPhraseModal){
|
||||
signPhrasePopup.open();
|
||||
}
|
||||
}
|
||||
|
||||
SignPhraseModal {
|
||||
id: signPhrasePopup
|
||||
// Not Refactored Yet
|
||||
// signingPhraseText: walletView.store.walletModelInst.utilsView.signingPhrase
|
||||
onRemindLaterButtonClicked: {
|
||||
hideSignPhraseModal = true;
|
||||
signPhrasePopup.close();
|
||||
}
|
||||
}
|
||||
|
||||
SeedPhraseBackupWarningPanel {
|
||||
id: seedPhraseWarning
|
||||
width: parent.width
|
||||
anchors.top: parent.top
|
||||
// Not Refactored Yet (there is no wallet 2 is `base_bc`)
|
||||
// visible: !mnemonicModule.isBackedUp
|
||||
}
|
||||
|
||||
StatusAppTwoPanelLayout {
|
||||
id: layoutWalletTwoPanel
|
||||
anchors.top: seedPhraseWarning.bottom
|
||||
height: walletView.height - seedPhraseWarning.height
|
||||
width: walletView.width
|
||||
|
||||
Component.onCompleted: {
|
||||
// Read in RootStore
|
||||
// if (walletView.store.onboardingModelInst.firstTimeLogin) {
|
||||
// walletView.store.onboardingModelInst.firstTimeLogin = false;
|
||||
// walletView.store.walletModelInst.setInitialRange();
|
||||
// }
|
||||
}
|
||||
|
||||
leftPanel: LeftTabView {
|
||||
id: leftTab
|
||||
anchors.fill: parent
|
||||
store: walletView.store
|
||||
onSavedAddressesClicked: {
|
||||
if (selected) {
|
||||
stackView.replace(cmpSavedAddresses);
|
||||
} else {
|
||||
stackView.replace(walletInfoContent);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
rightPanel: Item {
|
||||
property alias view: stackView
|
||||
anchors.fill: parent
|
||||
RowLayout {
|
||||
id: walletInfoContainer
|
||||
anchors.top: parent.top
|
||||
anchors.topMargin: 31
|
||||
anchors.bottom: walletFooter.top
|
||||
anchors.bottomMargin: 24
|
||||
anchors.left: parent.left
|
||||
anchors.leftMargin: 80
|
||||
anchors.right: parent.right
|
||||
anchors.rightMargin: 80
|
||||
StackBaseView {
|
||||
id: stackView
|
||||
Layout.fillWidth: true
|
||||
Layout.fillHeight: true
|
||||
initialItem: Item {
|
||||
id: walletInfoContent
|
||||
WalletHeaderPanel {
|
||||
id: walletHeader
|
||||
store: walletView.store
|
||||
// Not Refactored Yet
|
||||
// accountsModel: walletView.store.walletModelV2Inst.accountsView.accounts
|
||||
// currentAccount: walletView.store.walletModelV2Inst.accountsView.currentAccount
|
||||
// qrCode: walletView.store.profileModelInst.qrCode(walletView.store.selectedAccount.address)
|
||||
// allNetworksModel: walletView.store.walletModelV2Inst.networksView.allNetworks
|
||||
// enabledNetworksModel: walletView.store.walletModelV2Inst.networksView.enabledNetworks
|
||||
// onToggleNetwork: {
|
||||
// walletView.store.walletModelV2Inst.networksView.toggleNetwork(chainId)
|
||||
// }
|
||||
onCopyText: {
|
||||
walletView.store.copyText(text);
|
||||
}
|
||||
}
|
||||
TabBar {
|
||||
id: walletTabBar
|
||||
anchors.right: parent.right
|
||||
anchors.left: parent.left
|
||||
anchors.top: walletHeader.bottom
|
||||
anchors.topMargin: Style.current.padding
|
||||
height: childrenRect.height
|
||||
spacing: 24
|
||||
background: null
|
||||
StatusTabButton {
|
||||
id: assetsBtn
|
||||
btnText: qsTr("Assets")
|
||||
}
|
||||
StatusTabButton {
|
||||
id: positionsBtn
|
||||
btnText: qsTr("Positions")
|
||||
}
|
||||
StatusTabButton {
|
||||
id: collectiblesBtn
|
||||
btnText: qsTr("Collectibles")
|
||||
}
|
||||
StatusTabButton {
|
||||
id: activityBtn
|
||||
btnText: qsTr("Activity")
|
||||
}
|
||||
}
|
||||
StackLayout {
|
||||
id: stackLayout
|
||||
anchors.top: walletTabBar.bottom
|
||||
anchors.right: parent.right
|
||||
anchors.bottom: parent.bottom
|
||||
anchors.left: parent.left
|
||||
anchors.topMargin: Style.current.bigPadding
|
||||
currentIndex: walletTabBar.currentIndex
|
||||
|
||||
AssetsView {
|
||||
id: assetsTab
|
||||
onAssetClicked: {
|
||||
stackView.replace(assetDetailView);
|
||||
}
|
||||
}
|
||||
PositionsView {
|
||||
id: positionsTab
|
||||
}
|
||||
CollectiblesView {
|
||||
id: collectiblesTab
|
||||
store: walletView.store
|
||||
onCollectibleClicked: {
|
||||
stackView.replace(collectibleDetailView);
|
||||
}
|
||||
}
|
||||
ActivityView {
|
||||
id: activityTab
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Component {
|
||||
id: assetDetailView
|
||||
AssetDetailView {
|
||||
onBackPressed: {
|
||||
stackView.replace(walletInfoContent);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Component {
|
||||
id: collectibleDetailView
|
||||
CollectibleDetailView {
|
||||
store: walletView.store
|
||||
onBackPressed: {
|
||||
stackView.replace(walletInfoContent);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Component {
|
||||
id: cmpSavedAddresses
|
||||
SavedAddressesView {
|
||||
store: walletView.store
|
||||
}
|
||||
}
|
||||
|
||||
WalletFooterPanel {
|
||||
id: walletFooter
|
||||
anchors.bottom: parent.bottom
|
||||
// Not Refactored Yet
|
||||
// walletV2Model: walletView.store.walletModelV2Inst
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
|
@ -1,84 +0,0 @@
|
|||
import QtQuick 2.13
|
||||
import QtQuick.Controls 2.13
|
||||
import QtQuick.Layouts 1.13
|
||||
|
||||
import StatusQ.Components 0.1
|
||||
import StatusQ.Core.Theme 0.1
|
||||
import StatusQ.Core 0.1
|
||||
import StatusQ.Controls 0.1
|
||||
|
||||
Item {
|
||||
id: collectiblesDetailHeader
|
||||
height: childrenRect.height
|
||||
|
||||
property alias primaryText: collectibleName.text
|
||||
property alias secondaryText: collectibleId.text
|
||||
property StatusImageSettings image: StatusImageSettings {
|
||||
width: 40
|
||||
height: 40
|
||||
}
|
||||
signal hideButtonClicked()
|
||||
|
||||
Row {
|
||||
id: collectibleRow
|
||||
anchors.top: parent.top
|
||||
anchors.topMargin: 63
|
||||
anchors.left: parent.left
|
||||
width: parent.width - sendButton.width
|
||||
|
||||
spacing: 8
|
||||
|
||||
Loader {
|
||||
id: identiconLoader
|
||||
anchors.verticalCenter: parent.verticalCenter
|
||||
sourceComponent: !!collectiblesDetailHeader.image.source.toString() ? roundedImage : statusLetterIdenticonCmp
|
||||
}
|
||||
|
||||
StatusBaseText {
|
||||
id: collectibleName
|
||||
width: Math.min(parent.width - identiconLoader.width - collectibleId.width - 24, implicitWidth)
|
||||
anchors.verticalCenter: parent.verticalCenter
|
||||
font.pixelSize: 28
|
||||
lineHeight: 38
|
||||
lineHeightMode: Text.FixedHeight
|
||||
elide: Text.ElideRight
|
||||
color: Theme.palette.directColor1
|
||||
}
|
||||
|
||||
StatusBaseText {
|
||||
id: collectibleId
|
||||
anchors.verticalCenter: collectibleName.verticalCenter
|
||||
font.pixelSize: 28
|
||||
lineHeight: 38
|
||||
lineHeightMode: Text.FixedHeight
|
||||
color: Theme.palette.baseColor1
|
||||
}
|
||||
}
|
||||
|
||||
Component {
|
||||
id: roundedImage
|
||||
StatusRoundedImage {
|
||||
image.source: collectiblesDetailHeader.image.source
|
||||
}
|
||||
}
|
||||
|
||||
Component {
|
||||
id: statusLetterIdenticonCmp
|
||||
StatusLetterIdenticon {
|
||||
width: 40
|
||||
height: 40
|
||||
letterSize: 20
|
||||
color: Theme.palette.miscColor5
|
||||
name: collectibleName.text
|
||||
}
|
||||
}
|
||||
|
||||
StatusButton {
|
||||
id: sendButton
|
||||
anchors.bottom: collectibleRow.bottom
|
||||
anchors.right: parent.right
|
||||
icon.name: "send"
|
||||
text: qsTr("Send")
|
||||
onClicked: { console.log("TODO"); }
|
||||
}
|
||||
}
|
|
@ -1,68 +0,0 @@
|
|||
import QtQuick 2.13
|
||||
import QtGraphicalEffects 1.13
|
||||
|
||||
import utils 1.0
|
||||
import shared 1.0
|
||||
import shared.panels 1.0
|
||||
|
||||
|
||||
Rectangle {
|
||||
id: headerButton
|
||||
width: buttonImage.width + buttonText.width + Style.current.smallPadding * 2
|
||||
+ (text === "" ? 0 : headerButton.btnMargin)
|
||||
height: buttonText.height + Style.current.smallPadding * 2
|
||||
border.width: 0
|
||||
color: Style.current.transparent
|
||||
radius: Style.current.radius
|
||||
|
||||
property int btnMargin
|
||||
property string text: ""
|
||||
property url imageSource
|
||||
property bool flipImage: false
|
||||
signal clicked()
|
||||
|
||||
SVGImage {
|
||||
id: buttonImage
|
||||
height: 18
|
||||
anchors.left: parent.left
|
||||
anchors.leftMargin: Style.current.smallPadding
|
||||
anchors.verticalCenter: parent.verticalCenter
|
||||
fillMode: Image.PreserveAspectFit
|
||||
source: headerButton.imageSource
|
||||
rotation: flipImage ? 180 : 0
|
||||
|
||||
ColorOverlay {
|
||||
anchors.fill: parent
|
||||
source: parent
|
||||
color: Style.current.primary
|
||||
}
|
||||
}
|
||||
|
||||
StyledText {
|
||||
id: buttonText
|
||||
visible: !!headerButton.text
|
||||
text: headerButton.text
|
||||
anchors.left: buttonImage.right
|
||||
anchors.leftMargin: headerButton.btnMargin
|
||||
anchors.verticalCenter: parent.verticalCenter
|
||||
font.pixelSize: 13
|
||||
font.family: Style.current.fontMedium.name
|
||||
font.weight: Font.Medium
|
||||
color: Style.current.blue
|
||||
}
|
||||
|
||||
MouseArea {
|
||||
anchors.fill: parent
|
||||
hoverEnabled: true
|
||||
cursorShape: Qt.PointingHandCursor
|
||||
onEntered: {
|
||||
headerButton.color = Style.current.secondaryBackground;
|
||||
}
|
||||
onExited: {
|
||||
headerButton.color = Style.current.transparent;
|
||||
}
|
||||
onClicked: {
|
||||
headerButton.clicked();
|
||||
}
|
||||
}
|
||||
}
|
|
@ -1,33 +0,0 @@
|
|||
import QtQuick 2.13
|
||||
import QtQuick.Controls 2.13
|
||||
|
||||
|
||||
import utils 1.0
|
||||
|
||||
import StatusQ.Core 0.1
|
||||
import StatusQ.Core.Theme 0.1
|
||||
import StatusQ.Controls 0.1
|
||||
|
||||
Item {
|
||||
id: addEditError
|
||||
anchors.left: parent.left
|
||||
anchors.right: parent.right
|
||||
|
||||
property alias text: label.text
|
||||
|
||||
StatusIcon {
|
||||
id: errorIcon
|
||||
icon: "warning"
|
||||
color: Theme.palette.dangerColor1
|
||||
anchors.verticalCenter: parent.verticalCenter
|
||||
anchors.left: parent.left
|
||||
}
|
||||
StatusBaseText {
|
||||
id: label
|
||||
anchors.verticalCenter: parent.verticalCenter
|
||||
anchors.left: errorIcon.right
|
||||
anchors.leftMargin: Style.current.halfPadding
|
||||
font.pixelSize: 13
|
||||
color: Theme.palette.dangerColor1
|
||||
}
|
||||
}
|
|
@ -1,92 +0,0 @@
|
|||
import QtQuick 2.13
|
||||
import QtQuick.Controls 2.12
|
||||
import QtQuick.Layouts 1.12
|
||||
|
||||
|
||||
import utils 1.0
|
||||
import StatusQ.Core 0.1
|
||||
import StatusQ.Core.Theme 0.1
|
||||
import StatusQ.Components 0.1
|
||||
import StatusQ.Controls 0.1
|
||||
import StatusQ.Controls.Validators 0.1
|
||||
|
||||
Item {
|
||||
id: root
|
||||
width: parent.width
|
||||
height: 120
|
||||
|
||||
property bool deleteButtonVisible
|
||||
property string accountName: accountNameInput.text
|
||||
property bool nameInputValid: accountNameInput.valid
|
||||
property string accountAddress: model.address
|
||||
property string emoji: "" //TODO implement emoji selection
|
||||
signal deleteClicked()
|
||||
|
||||
RowLayout {
|
||||
anchors.fill: parent
|
||||
spacing: 0
|
||||
Item {
|
||||
Layout.fillWidth: true
|
||||
Layout.fillHeight: true
|
||||
StatusInput {
|
||||
id: accountNameInput
|
||||
anchors.fill: parent
|
||||
input.implicitHeight: 56
|
||||
input.placeholderText: qsTrId("enter-an-account-name...")
|
||||
label: "Ledger" //TODO replace with derivation path, for now use Ledger
|
||||
secondaryLabel: address.replace(address.substring(6, (address.length-4)), "...")
|
||||
validators: [StatusMinLengthValidator { minLength: 1 }]
|
||||
onTextChanged: {
|
||||
errorMessage = (accountNameInput.text === "") ?
|
||||
qsTrId("you-need-to-enter-an-account-name") : ""
|
||||
}
|
||||
}
|
||||
}
|
||||
Item {
|
||||
//emoji placeholder
|
||||
Layout.preferredWidth: 80
|
||||
Layout.fillHeight: true
|
||||
Layout.alignment: Qt.AlignTop
|
||||
Layout.topMargin: 8
|
||||
StatusBaseText {
|
||||
id: inputLabel
|
||||
text: "Emoji"
|
||||
font.weight: Font.Medium
|
||||
font.pixelSize: 13
|
||||
color: Style.current.textColor
|
||||
}
|
||||
Rectangle {
|
||||
width: parent.width
|
||||
height: 56
|
||||
anchors.top: inputLabel.bottom
|
||||
anchors.topMargin: 7
|
||||
radius: 10
|
||||
color: "pink"
|
||||
opacity: 0.6
|
||||
}
|
||||
}
|
||||
|
||||
Control {
|
||||
id: deleteButton
|
||||
Layout.preferredWidth: 50
|
||||
Layout.fillHeight: true
|
||||
Layout.alignment: Qt.AlignBottom
|
||||
visible: root.deleteButtonVisible
|
||||
background: Item {
|
||||
anchors.fill: deleteButton
|
||||
StatusIcon {
|
||||
anchors.centerIn: parent
|
||||
color: Theme.palette.baseColor1
|
||||
icon: "delete"
|
||||
}
|
||||
MouseArea {
|
||||
anchors.fill: parent
|
||||
cursorShape: Qt.PointingHandCursor
|
||||
onClicked: {
|
||||
root.deleteClicked();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
|
@ -1,66 +0,0 @@
|
|||
import QtQuick 2.13
|
||||
import QtGraphicalEffects 1.13
|
||||
|
||||
import utils 1.0
|
||||
import shared 1.0
|
||||
import shared.panels 1.0
|
||||
|
||||
Rectangle {
|
||||
id: walletBtnRoot
|
||||
width: btnImage.width + btnImage.anchors.leftMargin + btnImage.anchors.rightMargin +
|
||||
btnText.width + btnText.anchors.leftMargin + btnText.anchors.rightMargin
|
||||
height: btnText.height + Style.current.smallPadding * 2
|
||||
color: Style.current.transparent
|
||||
radius: Style.current.radius
|
||||
|
||||
property string text: ""
|
||||
property url imageSource
|
||||
property bool flipImage: false
|
||||
signal clicked()
|
||||
|
||||
SVGImage {
|
||||
id: btnImage
|
||||
height: 18
|
||||
anchors.left: parent.left
|
||||
anchors.leftMargin: Style.current.smallPadding
|
||||
anchors.verticalCenter: parent.verticalCenter
|
||||
fillMode: Image.PreserveAspectFit
|
||||
source: imageSource
|
||||
rotation: flipImage ? 180 : 0
|
||||
|
||||
ColorOverlay {
|
||||
anchors.fill: parent
|
||||
source: parent
|
||||
color: Style.current.primary
|
||||
}
|
||||
}
|
||||
|
||||
StyledText {
|
||||
id: btnText
|
||||
visible: !!walletBtnRoot.text
|
||||
text: walletBtnRoot.text
|
||||
anchors.left: btnImage.right
|
||||
anchors.leftMargin: Style.current.smallPadding
|
||||
anchors.rightMargin: Style.current.smallPadding
|
||||
anchors.verticalCenter: parent.verticalCenter
|
||||
font.pixelSize: 13
|
||||
font.family: Style.current.fontMedium.name
|
||||
font.weight: Font.Medium
|
||||
color: Style.current.blue
|
||||
}
|
||||
|
||||
MouseArea {
|
||||
anchors.fill: parent
|
||||
hoverEnabled: true
|
||||
cursorShape: Qt.PointingHandCursor
|
||||
onEntered: {
|
||||
parent.color = Style.current.secondaryBackground;
|
||||
}
|
||||
onExited: {
|
||||
parent.color = Style.current.transparent;
|
||||
}
|
||||
onClicked: {
|
||||
walletBtnRoot.clicked();
|
||||
}
|
||||
}
|
||||
}
|
|
@ -1,47 +0,0 @@
|
|||
import QtQuick 2.13
|
||||
import QtQuick.Layouts 1.12
|
||||
|
||||
import StatusQ.Controls 0.1
|
||||
import StatusQ.Core 0.1
|
||||
import StatusQ.Core.Theme 0.1
|
||||
|
||||
ColumnLayout {
|
||||
id: root
|
||||
spacing: 8
|
||||
signal generateAccountClicked()
|
||||
signal proceedWithSeedClicked()
|
||||
|
||||
StatusBaseText {
|
||||
Layout.alignment: Qt.AlignHCenter
|
||||
font.pixelSize: 15
|
||||
text: qsTr("Is your seed phrase secure?")
|
||||
color: Theme.palette.dangerColor1
|
||||
}
|
||||
|
||||
StatusBaseText {
|
||||
Layout.preferredWidth: 345
|
||||
Layout.alignment: Qt.AlignHCenter
|
||||
horizontalAlignment: Text.AlignHCenter
|
||||
wrapMode: Text.WordWrap
|
||||
font.pixelSize: 15
|
||||
text: qsTr("We found no active accounts with that seed phrase. If it is a new account please ensure that it is secure. Scammers often provide you with a phrase and siphon funds later.\n")
|
||||
color: Theme.palette.baseColor1
|
||||
}
|
||||
|
||||
StatusButton {
|
||||
Layout.alignment: Qt.AlignHCenter
|
||||
text: qsTr("Generate an account using Status")
|
||||
onClicked: {
|
||||
root.generateAccountClicked();
|
||||
}
|
||||
}
|
||||
|
||||
StatusButton {
|
||||
Layout.alignment: Qt.AlignHCenter
|
||||
type: StatusBaseButton.Type.Danger
|
||||
text: qsTr("Proceed with seed phrase")
|
||||
onClicked: {
|
||||
root.proceedWithSeedClicked();
|
||||
}
|
||||
}
|
||||
}
|
|
@ -1,36 +0,0 @@
|
|||
import QtQuick 2.13
|
||||
import shared 1.0
|
||||
import shared.panels 1.0
|
||||
|
||||
import utils 1.0
|
||||
|
||||
Grid {
|
||||
id: root
|
||||
columns: 2
|
||||
spacing: 2
|
||||
visible: (chainRepeater.count > 0)
|
||||
property var model
|
||||
|
||||
Repeater {
|
||||
id: chainRepeater
|
||||
model: root.model
|
||||
width: parent.width
|
||||
height: parent.height
|
||||
|
||||
Rectangle {
|
||||
color: Utils.setColorAlpha(Style.current.blue, 0.1)
|
||||
width: text.width + Style.current.halfPadding
|
||||
height: text.height + Style.current.halfPadding
|
||||
radius: Style.current.radius
|
||||
|
||||
StyledText {
|
||||
id: text
|
||||
text: model.chainName
|
||||
color: Style.current.blue
|
||||
font.pixelSize: Style.current.secondaryTextFontSize
|
||||
anchors.verticalCenter: parent.verticalCenter
|
||||
anchors.horizontalCenter: parent.horizontalCenter
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
|
@ -1,75 +0,0 @@
|
|||
import QtQuick 2.13
|
||||
import shared 1.0
|
||||
import shared.panels 1.0
|
||||
|
||||
import utils 1.0
|
||||
import "../popups"
|
||||
|
||||
Item {
|
||||
id: root
|
||||
width: selectRectangle.width
|
||||
height: childrenRect.height
|
||||
property var allNetworks
|
||||
property var enabledNetworks
|
||||
signal toggleNetwork(int chainId)
|
||||
|
||||
Rectangle {
|
||||
id: selectRectangle
|
||||
border.width: 1
|
||||
border.color: Style.current.border
|
||||
radius: Style.current.radius
|
||||
width: text.width + Style.current.padding * 4
|
||||
height: text.height + Style.current.padding
|
||||
|
||||
StyledText {
|
||||
id: text
|
||||
text: qsTr("All networks")
|
||||
anchors.left: parent.left
|
||||
anchors.leftMargin: Style.current.padding
|
||||
anchors.verticalCenter: parent.verticalCenter
|
||||
font.pixelSize: Style.current.primaryTextFontSize
|
||||
}
|
||||
|
||||
SVGImage {
|
||||
id: caretImg
|
||||
width: 10
|
||||
height: 6
|
||||
source: Style.svg("caret")
|
||||
anchors.right: parent.right
|
||||
anchors.rightMargin: Style.current.padding
|
||||
anchors.verticalCenter: parent.verticalCenter
|
||||
fillMode: Image.PreserveAspectFit
|
||||
}
|
||||
}
|
||||
|
||||
MouseArea {
|
||||
anchors.fill: selectRectangle
|
||||
cursorShape: Qt.PointingHandCursor
|
||||
onClicked: {
|
||||
if (selectPopup.opened) {
|
||||
selectPopup.close();
|
||||
return;
|
||||
}
|
||||
selectPopup.open();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
NetworkFilterPanel {
|
||||
id: networkFilterPanel
|
||||
width: root.width
|
||||
anchors.topMargin: Style.current.halfPadding
|
||||
anchors.top: selectRectangle.bottom
|
||||
model: root.enabledNetworks
|
||||
}
|
||||
|
||||
NetworkSelectPopup {
|
||||
id: selectPopup
|
||||
x: (parent.width - width)
|
||||
y: (root.height - networkFilterPanel.height)
|
||||
model: root.allNetworks
|
||||
onToggleNetwork: {
|
||||
root.toggleNetwork(chainId)
|
||||
}
|
||||
}
|
||||
}
|
|
@ -1,61 +0,0 @@
|
|||
import QtQuick 2.13
|
||||
|
||||
|
||||
import utils 1.0
|
||||
import StatusQ.Core 0.1
|
||||
import StatusQ.Core.Theme 0.1
|
||||
import StatusQ.Components 0.1
|
||||
import StatusQ.Controls 0.1
|
||||
import StatusQ.Controls.Validators 0.1
|
||||
|
||||
Item {
|
||||
id: root
|
||||
visible: (opacity > 0.1)
|
||||
|
||||
property string emoji: "" //TBD
|
||||
property string accountName: accountNameInput.text
|
||||
property bool nameInputValid: accountNameInput.valid
|
||||
|
||||
Row {
|
||||
width: parent.width
|
||||
anchors.verticalCenter: parent.verticalCenter
|
||||
spacing: 10
|
||||
StatusInput {
|
||||
id: accountNameInput
|
||||
width: (parent.width - 100)
|
||||
input.implicitHeight: 56
|
||||
input.placeholderText: qsTrId("enter-an-account-name...")
|
||||
label: qsTrId("account-name")
|
||||
validators: [
|
||||
StatusMinLengthValidator {
|
||||
minLength: 1
|
||||
errorMessage: (accountNameInput.errors) ?
|
||||
qsTrId("you-need-to-enter-an-account-name") : ""
|
||||
}
|
||||
]
|
||||
}
|
||||
Item {
|
||||
//emoji placeholder
|
||||
width: 80
|
||||
height: parent.height
|
||||
anchors.top: parent.top
|
||||
anchors.topMargin: 11
|
||||
StatusBaseText {
|
||||
id: inputLabel
|
||||
text: "Emoji"
|
||||
font.weight: Font.Medium
|
||||
font.pixelSize: 13
|
||||
color: Style.current.textColor
|
||||
}
|
||||
Rectangle {
|
||||
width: parent.width
|
||||
height: 56
|
||||
anchors.top: inputLabel.bottom
|
||||
anchors.topMargin: 7
|
||||
radius: 10
|
||||
color: "pink"
|
||||
opacity: 0.6
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
|
@ -1,85 +0,0 @@
|
|||
import QtQuick 2.13
|
||||
import QtQuick.Controls 2.13
|
||||
import QtQuick.Layouts 1.13
|
||||
import QtGraphicalEffects 1.13
|
||||
|
||||
import utils 1.0
|
||||
import shared 1.0
|
||||
import shared.panels 1.0
|
||||
import "."
|
||||
|
||||
Rectangle {
|
||||
id: root
|
||||
height: visible ? 32 : 0
|
||||
color: Style.current.red
|
||||
|
||||
Row {
|
||||
spacing: Style.current.halfPadding
|
||||
anchors.horizontalCenter: parent.horizontalCenter
|
||||
anchors.verticalCenter: parent.verticalCenter
|
||||
|
||||
StyledText {
|
||||
anchors.verticalCenter: parent.verticalCenter
|
||||
color: Style.current.white
|
||||
font.pixelSize: 13
|
||||
text: qsTrId("back-up-your-seed-phrase")
|
||||
}
|
||||
|
||||
Control {
|
||||
width: 58
|
||||
height: 24
|
||||
background: Rectangle {
|
||||
radius: 4
|
||||
anchors.fill: parent
|
||||
border.color: Style.current.white
|
||||
color: "#19FFFFFF"
|
||||
}
|
||||
contentItem: Item {
|
||||
anchors.fill: parent
|
||||
Text {
|
||||
anchors.top: parent.top
|
||||
anchors.bottom: parent.bottom
|
||||
anchors.left: parent.left
|
||||
anchors.right: parent.right
|
||||
horizontalAlignment: Text.AlignHCenter
|
||||
verticalAlignment: Text.AlignVCenter
|
||||
font.pixelSize: 13
|
||||
font.weight: Font.Medium
|
||||
font.family: Style.current.fontRegular.name
|
||||
color: Style.current.white
|
||||
text: "Back up"
|
||||
}
|
||||
}
|
||||
MouseArea {
|
||||
cursorShape: Qt.PointingHandCursor
|
||||
anchors.fill: parent
|
||||
onClicked: { Global.openBackUpSeedPopup() }
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
SVGImage {
|
||||
id: closeImg
|
||||
height: 20
|
||||
width: 20
|
||||
anchors.top: parent.top
|
||||
anchors.topMargin: 6
|
||||
anchors.right: parent.right
|
||||
anchors.rightMargin: 18
|
||||
source: Style.svg("close-white")
|
||||
}
|
||||
ColorOverlay {
|
||||
anchors.fill: closeImg
|
||||
source: closeImg
|
||||
color: Style.current.white
|
||||
opacity: 0.7
|
||||
}
|
||||
MouseArea {
|
||||
anchors.fill: closeImg
|
||||
cursorShape: Qt.PointingHandCursor
|
||||
onClicked: ParallelAnimation {
|
||||
PropertyAnimation { target: root; property: "visible"; to: false; }
|
||||
PropertyAnimation { target: root; property: "y"; to: -1 * root.height }
|
||||
}
|
||||
}
|
||||
}
|
|
@ -1,57 +0,0 @@
|
|||
import QtQuick 2.14
|
||||
import QtQuick.Controls 2.14
|
||||
|
||||
import utils 1.0
|
||||
import "../controls"
|
||||
import "../popups"
|
||||
|
||||
Item {
|
||||
id: walletFooterRoot
|
||||
height: 50
|
||||
width: parent.width
|
||||
property var walletV2Model
|
||||
|
||||
Rectangle {
|
||||
anchors.top: parent.top
|
||||
anchors.left: parent.left
|
||||
anchors.right: parent.right
|
||||
height: 1
|
||||
color: Style.current.separator
|
||||
}
|
||||
|
||||
Row {
|
||||
anchors.centerIn: parent
|
||||
spacing: 50
|
||||
|
||||
WalletButton {
|
||||
imageSource: Style.svg("swap-icon")
|
||||
text: qsTr("Swap")
|
||||
onClicked: {
|
||||
console.log("TODO");
|
||||
}
|
||||
}
|
||||
|
||||
WalletButton {
|
||||
imageSource: Style.svg("send")
|
||||
text: qsTr("Send")
|
||||
onClicked: {
|
||||
console.log("TODO");
|
||||
}
|
||||
}
|
||||
|
||||
WalletButton {
|
||||
imageSource: Style.svg("crypto-icon")
|
||||
text: qsTr("Buy / Sell")
|
||||
onClicked: {
|
||||
cryptoServicesModal.open();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
CryptoServicesModal {
|
||||
id: cryptoServicesModal
|
||||
anchors.centerIn: parent
|
||||
// Not Refactored Yet
|
||||
// walletV2Model: walletFooterRoot.walletV2Model
|
||||
}
|
||||
}
|
|
@ -1,105 +0,0 @@
|
|||
import QtQuick 2.13
|
||||
import QtQuick.Controls 2.13
|
||||
import QtQuick.Layouts 1.13
|
||||
|
||||
|
||||
import utils 1.0
|
||||
import shared 1.0
|
||||
import shared.panels 1.0
|
||||
import shared.status 1.0
|
||||
import "../controls"
|
||||
import "../panels"
|
||||
import "../popups"
|
||||
|
||||
Item {
|
||||
id: walletHeader
|
||||
anchors.left: parent.left
|
||||
anchors.right: parent.right
|
||||
height: walletAddress.y + walletAddress.height
|
||||
|
||||
property var qrCode
|
||||
property var accountsModel
|
||||
property var currentAccount
|
||||
property var enabledNetworksModel
|
||||
property var allNetworksModel
|
||||
property var store
|
||||
signal copyText(string text)
|
||||
signal toggleNetwork(int chainId)
|
||||
|
||||
Row {
|
||||
id: accountRow
|
||||
anchors.top: parent.top
|
||||
anchors.topMargin: 24
|
||||
anchors.left: parent.left
|
||||
anchors.leftMargin: 24
|
||||
spacing: 8
|
||||
|
||||
StyledText {
|
||||
id: title
|
||||
anchors.verticalCenter: parent.verticalCenter
|
||||
text: walletHeader.currentAccount? walletHeader.currentAccount.name : ""
|
||||
font.weight: Font.Medium
|
||||
font.pixelSize: 28
|
||||
}
|
||||
|
||||
Rectangle {
|
||||
id: separatorDot
|
||||
width: 8
|
||||
height: 8
|
||||
anchors.verticalCenter: parent.verticalCenter
|
||||
anchors.verticalCenterOffset: 1
|
||||
color: Style.current.primary
|
||||
radius: 50
|
||||
}
|
||||
|
||||
StyledText {
|
||||
id: walletBalance
|
||||
anchors.verticalCenter: parent.verticalCenter
|
||||
text: walletHeader.currentAccount? walletHeader.currentAccount.balance.toUpperCase() : ""
|
||||
font.pixelSize: 22
|
||||
}
|
||||
}
|
||||
|
||||
MouseArea {
|
||||
anchors.fill: accountRow
|
||||
cursorShape: Qt.PointingHandCursor
|
||||
onClicked: {
|
||||
Global.openPopup(shareModalComponent);
|
||||
}
|
||||
}
|
||||
|
||||
StatusExpandableAddress {
|
||||
id: walletAddress
|
||||
anchors.top: accountRow.bottom
|
||||
anchors.left: accountRow.left
|
||||
addressWidth: 180
|
||||
address: walletHeader.currentAccount? walletHeader.currentAccount.address : ""
|
||||
store: walletHeader.store
|
||||
}
|
||||
|
||||
NetworkSelectPanel {
|
||||
id: networkSelect
|
||||
anchors.right: parent.right
|
||||
allNetworks: walletHeader.allNetworksModel
|
||||
enabledNetworks: walletHeader.enabledNetworksModel
|
||||
onToggleNetwork: {
|
||||
walletHeader.toggleNetwork(chainId)
|
||||
}
|
||||
}
|
||||
|
||||
Component {
|
||||
id: shareModalComponent
|
||||
ShareModal {
|
||||
anchors.centerIn: parent
|
||||
qrCode: walletHeader.qrCode
|
||||
accountsModel: walletHeader.accountsModel
|
||||
selectedAccount: walletHeader.currentAccount
|
||||
onCopy: {
|
||||
walletHeader.copyText(text);
|
||||
}
|
||||
onClosed: {
|
||||
this.destroy();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
|
@ -1,171 +0,0 @@
|
|||
import QtQuick 2.13
|
||||
import QtQuick.Controls 2.13
|
||||
import QtQuick.Dialogs 1.3
|
||||
|
||||
import utils 1.0
|
||||
|
||||
import StatusQ.Core 0.1
|
||||
import StatusQ.Core.Theme 0.1
|
||||
import StatusQ.Controls 0.1
|
||||
import StatusQ.Controls.Validators 0.1
|
||||
import StatusQ.Popups 0.1
|
||||
|
||||
import "../views"
|
||||
import "../panels"
|
||||
|
||||
StatusModal {
|
||||
id: root
|
||||
height: (keyOrSeedPhraseInput.input.edit.contentHeight > 56 || root.store.seedPhraseInserted) ? 517 : 498
|
||||
header.title: qsTr("Add account")
|
||||
|
||||
property int marginBetweenInputs: 20
|
||||
property var store
|
||||
signal addAccountClicked()
|
||||
|
||||
onOpened: {
|
||||
keyOrSeedPhraseInput.input.edit.forceActiveFocus(Qt.MouseFocusReason);
|
||||
}
|
||||
contentItem: Item {
|
||||
id: contentItem
|
||||
anchors.left: parent.left
|
||||
anchors.leftMargin: 8
|
||||
anchors.right: parent.right
|
||||
anchors.rightMargin: 10
|
||||
height: parent.height
|
||||
|
||||
Item {
|
||||
id: leftContent
|
||||
width: parent.width
|
||||
height: parent.height/2
|
||||
anchors.top: parent.top
|
||||
anchors.topMargin: root.marginBetweenInputs
|
||||
StatusInput {
|
||||
id: keyOrSeedPhraseInput
|
||||
anchors.fill: parent
|
||||
input.multiline: true
|
||||
input.icon.width: 15
|
||||
input.icon.height: 11
|
||||
input.icon.name: (root.store.isSeedCountValid) || Utils.isPrivateKey(keyOrSeedPhraseInput.text) ? "checkmark" : ""
|
||||
input.icon.color: Theme.palette.primaryColor1
|
||||
input.leftIcon: false
|
||||
input.implicitHeight: 56
|
||||
input.placeholderText: qsTr("Enter private key or seed phrase")
|
||||
label: qsTr("Private key or seed phrase")
|
||||
validators: [
|
||||
StatusValidator {
|
||||
validate: function (t) {
|
||||
errorMessage = root.store.validateTextInput(t);
|
||||
return ((t !== "") && ((root.store.isSeedCountValid && !root.store.seedPhraseNotFound(t))
|
||||
|| Utils.isPrivateKey(t))) ? true : { actual: t }
|
||||
}
|
||||
}
|
||||
]
|
||||
onTextChanged: {
|
||||
if (root.store.seedPhraseInserted) {
|
||||
root.store.seedPhraseInserted = true;
|
||||
seedAccountDetails.searching = true;
|
||||
seedAccountDetails.timer.start();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Rectangle {
|
||||
id: separator
|
||||
color: Theme.palette.statusPopupMenu.separatorColor
|
||||
}
|
||||
|
||||
PKeyAccountDetailsPanel {
|
||||
id: pkeyAccountDetails
|
||||
width: parent.width
|
||||
height: parent.height/2
|
||||
anchors.top: separator.bottom
|
||||
}
|
||||
|
||||
SeedAddAccountView {
|
||||
id: seedAccountDetails
|
||||
width: (parent.width/2)
|
||||
height: parent.height
|
||||
anchors.right: parent.right
|
||||
store: root.store
|
||||
}
|
||||
|
||||
states: [
|
||||
State {
|
||||
when: (root.store.isSeedCountValid && !root.store.seedPhraseNotFound(keyOrSeedPhraseInput.text))
|
||||
PropertyChanges {
|
||||
target: root
|
||||
width: 907
|
||||
}
|
||||
PropertyChanges {
|
||||
target: pkeyAccountDetails
|
||||
opacity: 0.0
|
||||
}
|
||||
PropertyChanges {
|
||||
target: leftContent
|
||||
width: contentItem.width/2
|
||||
height: contentItem.height
|
||||
}
|
||||
PropertyChanges {
|
||||
target: separator
|
||||
width: 1
|
||||
height: contentItem.height
|
||||
}
|
||||
AnchorChanges {
|
||||
target: separator
|
||||
anchors.left: leftContent.right
|
||||
}
|
||||
PropertyChanges {
|
||||
target: seedAccountDetails
|
||||
opacity: 1.0
|
||||
}
|
||||
},
|
||||
State {
|
||||
when: !(root.store.isSeedCountValid && !root.store.seedPhraseNotFound(keyOrSeedPhraseInput.text))
|
||||
PropertyChanges {
|
||||
target: root
|
||||
width: 574
|
||||
}
|
||||
PropertyChanges {
|
||||
target: seedAccountDetails
|
||||
opacity: 0.0
|
||||
}
|
||||
PropertyChanges {
|
||||
target: leftContent
|
||||
width: contentItem.width
|
||||
height: 120
|
||||
}
|
||||
PropertyChanges {
|
||||
target: pkeyAccountDetails
|
||||
opacity: 1.0
|
||||
}
|
||||
PropertyChanges {
|
||||
target: separator
|
||||
width: contentItem.width
|
||||
height: 1
|
||||
anchors.topMargin: (2*root.marginBetweenInputs)
|
||||
}
|
||||
AnchorChanges {
|
||||
target: separator
|
||||
anchors.left: contentItem.left
|
||||
anchors.top: leftContent.bottom
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
|
||||
rightButtons: [
|
||||
StatusButton {
|
||||
text: root.store.loadingAccounts ? qsTrId("loading") : qsTrId("add-account")
|
||||
enabled: (!root.loadingAccounts && root.store.validateAddAccountPopup(keyOrSeedPhraseInput.text, seedAccountDetails.activeAccountsList,
|
||||
keyOrSeedPhraseInput.valid, pkeyAccountDetails.nameInputValid))
|
||||
|
||||
onClicked : {
|
||||
root.store.addAccount(keyOrSeedPhraseInput.text, seedAccountDetails.activeAccountsList,
|
||||
keyOrSeedPhraseInput.valid, pkeyAccountDetails);
|
||||
root.addAccountClicked();
|
||||
root.close();
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
|
@ -1,138 +0,0 @@
|
|||
import QtQuick 2.13
|
||||
import QtQuick.Controls 2.13
|
||||
import QtQuick.Dialogs 1.3
|
||||
|
||||
import utils 1.0
|
||||
import shared.controls 1.0
|
||||
|
||||
import StatusQ.Core 0.1
|
||||
import StatusQ.Core.Theme 0.1
|
||||
import StatusQ.Controls 0.1
|
||||
import StatusQ.Controls.Validators 0.1
|
||||
import StatusQ.Popups 0.1
|
||||
|
||||
StatusModal {
|
||||
id: root
|
||||
width: 574
|
||||
height: 490
|
||||
header.title: edit ? qsTr("Edit saved address") : qsTr("Add saved address")
|
||||
header.subTitle: edit ? name : qsTr("Unnamed")
|
||||
onOpened: {
|
||||
edit ?
|
||||
nameInput.input.edit.forceActiveFocus(Qt.MouseFocusReason) :
|
||||
addressInput.input.edit.forceActiveFocus(Qt.MouseFocusReason);
|
||||
}
|
||||
|
||||
property var store
|
||||
property bool loading: false
|
||||
property bool edit: false
|
||||
property bool valid: addressInput.valid && nameInput.valid // TODO: Add network preference and emoji
|
||||
property bool dirty: addressInput.input.dirty && nameInput.input.dirty
|
||||
property alias address: addressInput.text
|
||||
property alias name: nameInput.text
|
||||
property int validationMode: edit ?
|
||||
StatusInput.ValidationMode.Always :
|
||||
StatusInput.ValidationMode.OnlyWhenDirty
|
||||
signal beforeSave()
|
||||
|
||||
contentItem: Column {
|
||||
anchors.left: parent.left
|
||||
anchors.leftMargin: 8
|
||||
anchors.right: parent.right
|
||||
anchors.rightMargin: 10
|
||||
height: childrenRect.height
|
||||
|
||||
StatusInput {
|
||||
id: addressInput
|
||||
input.leftIcon: false
|
||||
input.implicitHeight: 56
|
||||
input.placeholderText: qsTr("Enter a valid address or ENS name")
|
||||
label: qsTr("Address")
|
||||
validators: [
|
||||
StatusAddressOrEnsValidator {
|
||||
errorMessage: qsTr("Invalid address or ENS name")
|
||||
},
|
||||
StatusMinLengthValidator {
|
||||
errorMessage: qsTr("Please provide an address or ENS name")
|
||||
}
|
||||
]
|
||||
validationMode: root.validationMode
|
||||
input.enabled: !root.edit
|
||||
}
|
||||
|
||||
Row {
|
||||
id: accountNameInputRow
|
||||
anchors.left: parent.left
|
||||
anchors.right: parent.right
|
||||
height: 82
|
||||
spacing: 10
|
||||
Item {
|
||||
implicitWidth: 434
|
||||
height: parent.height
|
||||
StatusInput {
|
||||
id: nameInput
|
||||
anchors.fill: parent
|
||||
input.implicitHeight: 56
|
||||
input.placeholderText: qsTr("Enter a name")
|
||||
label: qsTr("Name")
|
||||
validators: [
|
||||
StatusMinLengthValidator {
|
||||
minLength: 1
|
||||
errorMessage: qsTr("Name must not be blank")
|
||||
}
|
||||
]
|
||||
validationMode: root.validationMode
|
||||
}
|
||||
}
|
||||
Item {
|
||||
//emoji placeholder
|
||||
width: 80
|
||||
height: parent.height
|
||||
anchors.top: parent.top
|
||||
anchors.topMargin: 11
|
||||
StatusBaseText {
|
||||
id: inputLabel
|
||||
text: "Emoji"
|
||||
font.weight: Font.Medium
|
||||
font.pixelSize: 13
|
||||
color: Theme.palette.directColor1
|
||||
}
|
||||
Rectangle {
|
||||
width: parent.width
|
||||
height: 56
|
||||
anchors.top: inputLabel.bottom
|
||||
anchors.topMargin: 7
|
||||
radius: 10
|
||||
color: "pink"
|
||||
opacity: 0.6
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
rightButtons: [
|
||||
StatusButton {
|
||||
text: root.edit ? qsTr("Save") : qsTr("Add address")
|
||||
enabled: !root.loading && root.valid && root.dirty
|
||||
loading: root.loading
|
||||
|
||||
MessageDialog {
|
||||
id: accountError
|
||||
title: qsTr("Adding the account failed")
|
||||
icon: StandardIcon.Critical
|
||||
standardButtons: StandardButton.Ok
|
||||
}
|
||||
|
||||
onClicked: {
|
||||
// Not Refactored Yet
|
||||
// root.loading = true;
|
||||
// root.beforeSave();
|
||||
// edit ?
|
||||
// root.store.walletModelV2Inst.savedAddressesView.editSavedAddress(name, address) :
|
||||
// root.store.walletModelV2Inst.savedAddressesView.addSavedAddress(name, address);
|
||||
// root.close()
|
||||
// root.loading = false;
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
|
@ -1,120 +0,0 @@
|
|||
import QtQuick 2.14
|
||||
import QtQuick.Controls 2.14
|
||||
|
||||
import utils 1.0
|
||||
import shared.panels 1.0
|
||||
|
||||
import StatusQ.Popups 0.1
|
||||
import StatusQ.Components 0.1
|
||||
|
||||
import "../controls"
|
||||
|
||||
StatusModal {
|
||||
id: cryptoServicesPopupRoot
|
||||
height: 400
|
||||
header.title: qsTr("Buy crypto")
|
||||
property var walletV2Model
|
||||
|
||||
onOpened: {
|
||||
loader.active = true;
|
||||
// Not Refactored Yet
|
||||
// cryptoServicesPopupRoot.walletV2Model.cryptoServiceController.fetchCryptoServices();
|
||||
}
|
||||
|
||||
// Not Refactored Yet
|
||||
// Connections {
|
||||
// target: cryptoServicesPopupRoot.walletV2Model.cryptoServiceController
|
||||
// function onFetchCryptoServicesFetched() {
|
||||
// loader.sourceComponent = servicesComponent;
|
||||
// }
|
||||
// }
|
||||
|
||||
Loader {
|
||||
id: loader
|
||||
anchors.fill: parent
|
||||
active: false
|
||||
sourceComponent: loadingComponent
|
||||
|
||||
Component {
|
||||
id: loadingComponent
|
||||
StatusLoadingIndicator {
|
||||
anchors.centerIn: parent
|
||||
}
|
||||
}
|
||||
|
||||
Component {
|
||||
id: servicesComponent
|
||||
Item {
|
||||
StyledText {
|
||||
id: note
|
||||
anchors.top: parent.top
|
||||
anchors.horizontalCenter: parent.horizontalCenter
|
||||
color: Style.current.secondaryText
|
||||
text: qsTr("Choose a service you'd like to use to buy crypto")
|
||||
}
|
||||
|
||||
ListView {
|
||||
anchors.top: note.bottom
|
||||
anchors.bottom: parent.bottom
|
||||
anchors.topMargin: Style.current.padding
|
||||
width: parent.width
|
||||
// Not Refactored Yet
|
||||
// model: cryptoServicesPopupRoot.walletV2Model.cryptoServiceController.cryptoServiceModel
|
||||
focus: true
|
||||
spacing: Style.current.padding
|
||||
clip: true
|
||||
|
||||
delegate: Item {
|
||||
implicitHeight: row.height
|
||||
width: parent.width
|
||||
|
||||
Row {
|
||||
id: row
|
||||
width: parent.width
|
||||
spacing: Style.current.padding
|
||||
|
||||
StatusRoundedImage {
|
||||
image.source: logoUrl
|
||||
border.width: 1
|
||||
border.color: Style.current.border
|
||||
}
|
||||
|
||||
Column {
|
||||
spacing: Style.current.halfPadding * 0.5
|
||||
|
||||
StyledText {
|
||||
text: name
|
||||
font.bold: true
|
||||
font.pixelSize: Style.current.secondaryTextFontSize
|
||||
}
|
||||
|
||||
StyledText {
|
||||
text: description
|
||||
font.pixelSize: Style.current.tertiaryTextFontSize
|
||||
}
|
||||
|
||||
StyledText {
|
||||
text: fees
|
||||
color: Style.current.secondaryText
|
||||
font.pixelSize: Style.current.asideTextFontSize
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
MouseArea {
|
||||
anchors.fill: parent
|
||||
acceptedButtons: Qt.LeftButton
|
||||
hoverEnabled: true
|
||||
cursorShape: Qt.PointingHandCursor
|
||||
|
||||
onClicked: {
|
||||
Global.openLink(siteUrl);
|
||||
cryptoServicesPopupRoot.close();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
|
@ -1,83 +0,0 @@
|
|||
import QtQuick 2.13
|
||||
import QtQuick.Controls 2.13
|
||||
import QtQuick.Layouts 1.3
|
||||
import QtGraphicalEffects 1.0
|
||||
|
||||
import StatusQ.Core 0.1
|
||||
import StatusQ.Core.Theme 0.1
|
||||
import StatusQ.Components 0.1
|
||||
import StatusQ.Controls 0.1
|
||||
|
||||
import utils 1.0
|
||||
|
||||
// TODO: replace with StatusModal
|
||||
Popup {
|
||||
id: popup
|
||||
modal: false
|
||||
width: 360
|
||||
height: 432
|
||||
closePolicy: Popup.CloseOnEscape
|
||||
property var model
|
||||
signal toggleNetwork(int chainId)
|
||||
|
||||
background: Rectangle {
|
||||
radius: Style.current.radius
|
||||
color: Style.current.background
|
||||
border.color: Style.current.border
|
||||
layer.enabled: true
|
||||
layer.effect: DropShadow{
|
||||
verticalOffset: 3
|
||||
radius: 8
|
||||
samples: 15
|
||||
fast: true
|
||||
cached: true
|
||||
color: "#22000000"
|
||||
}
|
||||
}
|
||||
|
||||
contentItem: ScrollView {
|
||||
id: scrollView
|
||||
contentHeight: content.height
|
||||
width: popup.width
|
||||
height: popup.height
|
||||
|
||||
ScrollBar.horizontal.policy: ScrollBar.AlwaysOff
|
||||
clip: true
|
||||
|
||||
Column {
|
||||
id: content
|
||||
width: popup.width
|
||||
spacing: Style.current.padding
|
||||
|
||||
Repeater {
|
||||
id: chainRepeater
|
||||
model: popup.model
|
||||
|
||||
Item {
|
||||
width: content.width
|
||||
height: 40
|
||||
StatusBaseText {
|
||||
anchors.left: parent.left
|
||||
anchors.leftMargin: Style.current.bigPadding
|
||||
anchors.verticalCenter: parent.verticalCenter
|
||||
font.pixelSize: Style.current.primaryTextFontSize
|
||||
text: model.chainName
|
||||
color: Theme.palette.directColor1
|
||||
}
|
||||
|
||||
StatusCheckBox {
|
||||
anchors.right: parent.right
|
||||
anchors.rightMargin: Style.current.bigPadding
|
||||
anchors.verticalCenter: parent.verticalCenter
|
||||
checked: model.enabled
|
||||
onCheckedChanged: {
|
||||
if(checked !== model.enabled){
|
||||
popup.toggleNetwork(model.chainId)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
|
@ -1,131 +0,0 @@
|
|||
import QtQuick 2.13
|
||||
|
||||
import StatusQ.Core 0.1
|
||||
import StatusQ.Popups 0.1
|
||||
import StatusQ.Controls 0.1
|
||||
import StatusQ.Core.Theme 0.1
|
||||
import shared.panels 1.0
|
||||
|
||||
StatusModal {
|
||||
id: shareModal
|
||||
implicitWidth: 454
|
||||
implicitHeight: 568
|
||||
property var selectedAccount
|
||||
property var accountsModel
|
||||
property var qrCode
|
||||
signal copy(string text)
|
||||
|
||||
// To-do Icon in header needs to be updated once emoji picker is ready
|
||||
header.title: shareModal.selectedAccount.name
|
||||
header.subTitle: qsTr("Basic address")
|
||||
header.popupMenu: StatusPopupMenu {
|
||||
id: accountPickerPopUp
|
||||
Repeater {
|
||||
id: repeater
|
||||
model: shareModal.accountsModel
|
||||
delegate: Loader {
|
||||
sourceComponent: accountPickerPopUp.delegate
|
||||
onLoaded: {
|
||||
item.action.text = model.name
|
||||
// To-do this and Icon in header needs to be updated once emoji picker is ready
|
||||
item.action.iconSettings.name = "filled-account"
|
||||
}
|
||||
Connections {
|
||||
enabled: (!!item && !!item.action)
|
||||
target: enabled ? item.action : null
|
||||
onTriggered: {
|
||||
shareModal.selectedAccount = { address, name, iconColor, fiatBalance }
|
||||
accountPickerPopUp.dismiss()
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Image {
|
||||
id: qrCodeImage
|
||||
width: 273
|
||||
height: 270
|
||||
anchors.top: parent.top
|
||||
anchors.topMargin: 24
|
||||
anchors.horizontalCenter: parent.horizontalCenter
|
||||
|
||||
asynchronous: true
|
||||
fillMode: Image.PreserveAspectFit
|
||||
mipmap: true
|
||||
smooth: false
|
||||
source: shareModal.qrCode
|
||||
StatusIcon {
|
||||
width: 66
|
||||
height: 66
|
||||
anchors.centerIn: parent
|
||||
icon: "snt"
|
||||
}
|
||||
}
|
||||
|
||||
Column {
|
||||
id: addressColumn
|
||||
anchors.horizontalCenter: parent.horizontalCenter
|
||||
anchors.top: qrCodeImage.bottom
|
||||
anchors.topMargin: 25
|
||||
|
||||
spacing: 8
|
||||
StyledText {
|
||||
anchors.horizontalCenter: parent.horizontalCenter
|
||||
text: qsTr("Your wallet address")
|
||||
color: Theme.palette.directColor4
|
||||
font.pixelSize: 13
|
||||
font.weight: Font.Medium
|
||||
lineHeight: 18
|
||||
lineHeightMode: Text.FixedHeight
|
||||
}
|
||||
|
||||
StyledText {
|
||||
anchors.horizontalCenter: parent.horizontalCenter
|
||||
text: shareModal.selectedAccount.address
|
||||
color: Theme.palette.directColor1
|
||||
font.pixelSize: 13
|
||||
font.weight: Font.Medium
|
||||
lineHeight: 18
|
||||
lineHeightMode: Text.FixedHeight
|
||||
}
|
||||
}
|
||||
|
||||
Row {
|
||||
anchors.horizontalCenter: parent.horizontalCenter
|
||||
anchors.top: addressColumn.bottom
|
||||
anchors.topMargin: 25
|
||||
|
||||
spacing: 20
|
||||
|
||||
Repeater {
|
||||
model: 2
|
||||
Column {
|
||||
spacing: 5
|
||||
StatusRoundButton {
|
||||
anchors.horizontalCenter: parent.horizontalCenter
|
||||
icon.name: index === 0 ? "copy" : "link"
|
||||
onClicked: {
|
||||
if (index === 0) {
|
||||
if (shareModal.selectedAccount.address) {
|
||||
shareModal.copy(shareModal.selectedAccount.address);
|
||||
}
|
||||
else {
|
||||
// To-do Get link functionality
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
StyledText {
|
||||
anchors.horizontalCenter: parent.horizontalCenter
|
||||
text: index === 0 ? qsTr("Copy") : qsTr("Get link")
|
||||
color: Theme.palette.primaryColor1
|
||||
font.pixelSize: 13
|
||||
font.weight: Font.Medium
|
||||
lineHeight: 18
|
||||
lineHeightMode: Text.FixedHeight
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
|
@ -1,108 +0,0 @@
|
|||
import QtQuick 2.13
|
||||
import QtQuick.Controls 2.13
|
||||
import QtQuick.Layouts 1.13
|
||||
|
||||
import utils 1.0
|
||||
|
||||
import StatusQ.Core 0.1
|
||||
import StatusQ.Core.Theme 0.1
|
||||
import StatusQ.Popups 0.1
|
||||
import StatusQ.Controls 0.1
|
||||
|
||||
StatusModal {
|
||||
id: signPhrasePopup
|
||||
anchors.centerIn: parent
|
||||
height: 390
|
||||
closePolicy: Popup.NoAutoClose
|
||||
|
||||
header.title: qsTrId("signing-phrase")
|
||||
property string signingPhraseText: ""
|
||||
signal remindLaterButtonClicked()
|
||||
|
||||
contentItem: Item {
|
||||
width: signPhrasePopup.width
|
||||
height: childrenRect.height
|
||||
Column {
|
||||
anchors.top: parent.top
|
||||
anchors.topMargin: 16
|
||||
width: parent.width - 32
|
||||
anchors.horizontalCenter: parent.horizontalCenter
|
||||
|
||||
StatusBaseText {
|
||||
height: (Style.current.padding * 3)
|
||||
anchors.horizontalCenter: parent.horizontalCenter
|
||||
horizontalAlignment: Text.AlignHCenter
|
||||
font.pixelSize: 17
|
||||
font.weight: Font.Bold
|
||||
text: qsTrId("this-is-you-signing")
|
||||
}
|
||||
|
||||
StatusBaseText {
|
||||
width: 330
|
||||
height: Style.current.padding * 4
|
||||
anchors.horizontalCenter: parent.horizontalCenter
|
||||
horizontalAlignment: Text.AlignHCenter
|
||||
font.pixelSize: 15
|
||||
wrapMode: Text.WordWrap
|
||||
text: qsTrId("three-words-description")
|
||||
}
|
||||
|
||||
Rectangle {
|
||||
width: parent.width
|
||||
height: 44
|
||||
color: Theme.palette.baseColor2
|
||||
StatusBaseText {
|
||||
id: signingPhrase
|
||||
anchors.horizontalCenter: parent.horizontalCenter
|
||||
anchors.verticalCenter: parent.verticalCenter
|
||||
font.pixelSize: 15
|
||||
text: signPhrasePopup.signingPhraseText
|
||||
}
|
||||
}
|
||||
|
||||
Item {
|
||||
width: parent.width
|
||||
height: 30
|
||||
StatusIcon {
|
||||
icon: "warning"
|
||||
width: 13.33
|
||||
height: 13.33
|
||||
anchors.horizontalCenter: parent.horizontalCenter
|
||||
anchors.bottom: parent.bottom
|
||||
color: Theme.palette.dangerColor1
|
||||
}
|
||||
}
|
||||
|
||||
StatusBaseText {
|
||||
width: parent.width
|
||||
height: 18
|
||||
anchors.horizontalCenter: parent.horizontalCenter
|
||||
verticalAlignment: Text.AlignVCenter
|
||||
horizontalAlignment: Text.AlignHCenter
|
||||
font.pixelSize: 13
|
||||
color: Theme.palette.dangerColor1
|
||||
//% "If you see a different combination, cancel the transaction and sign out"
|
||||
text: qsTrId("three-words-description-2")
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
rightButtons: [
|
||||
StatusFlatButton {
|
||||
//% "Ok, got it"
|
||||
text: qsTrId("ens-got-it")
|
||||
onClicked: {
|
||||
//TOOD improve this to not use dynamic scoping
|
||||
localAccountSensitiveSettings.hideSignPhraseModal = true;
|
||||
close();
|
||||
}
|
||||
},
|
||||
StatusButton {
|
||||
//% "Remind me later"
|
||||
text: qsTrId("remind-me-later")
|
||||
onClicked: {
|
||||
signPhrasePopup.remindLaterButtonClicked();
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
|
@ -1,20 +0,0 @@
|
|||
import QtQuick 2.13
|
||||
import QtQuick.Dialogs 1.3
|
||||
|
||||
import utils 1.0
|
||||
|
||||
QtObject {
|
||||
id: root
|
||||
|
||||
property string name
|
||||
property string collectibleId
|
||||
property string description: qsTr("Collectibles")
|
||||
property color backgroundColor: "transparent"
|
||||
property url collectibleImageUrl
|
||||
property url permalink
|
||||
property url imageUrl
|
||||
property var properties
|
||||
property var rankings
|
||||
property var stats
|
||||
property int collectionIndex
|
||||
}
|
|
@ -1,230 +0,0 @@
|
|||
import QtQuick 2.13
|
||||
import QtQuick.Dialogs 1.3
|
||||
|
||||
import utils 1.0
|
||||
|
||||
QtObject {
|
||||
id: root
|
||||
|
||||
property CollectiblesStore collectiblesStore: CollectiblesStore { }
|
||||
// Not Refactored Yet
|
||||
// property var walletModelInst: walletModel
|
||||
// Not Refactored Yet
|
||||
// property var walletModelV2Inst: walletV2Model
|
||||
// Not Refactored Yet
|
||||
// property var profileModelInst: profileModel
|
||||
// Not Refactored Yet
|
||||
// property var chatsModelInst: chatsModel
|
||||
|
||||
// This should be exposed to the UI via "walletModule", WalletModule should use
|
||||
// Accounts Service which keeps the info about that (isFirstTimeAccountLogin).
|
||||
// Then in the View of WalletModule we may have either QtProperty or
|
||||
// Q_INVOKABLE function (proc marked as slot) depends on logic/need.
|
||||
// The only need for onboardingModel here is actually to check if an account
|
||||
// has been just created or an old one.
|
||||
|
||||
// property var onboardingModelInst: onboardingModel
|
||||
property int selectedAccount: 0
|
||||
|
||||
function getSavedAddressErrorText(savedAddresses, error) {
|
||||
switch (error) {
|
||||
case savedAddresses.Error.CreateSavedAddressError:
|
||||
return qsTr("Error creating new saved address, please try again later.");
|
||||
case savedAddresses.Error.DeleteSavedAddressError:
|
||||
return qsTr("Error deleting saved address, please try again later.");
|
||||
case savedAddresses.Error.ReadSavedAddressesError:
|
||||
return qsTr("Error getting saved addresses, please try again later.");
|
||||
case savedAddresses.Error.UpdateSavedAddressError:
|
||||
return qsTr("Error updating saved address, please try again later.");
|
||||
default: return "";
|
||||
}
|
||||
}
|
||||
|
||||
function copyText(text) {
|
||||
// Not Refactored Yet
|
||||
// root.chatsModelInst.copyToClipboard(text);
|
||||
}
|
||||
|
||||
function changeSelectedAccount(newIndex) {
|
||||
// Not Refactored Yet
|
||||
// if (newIndex > root.walletModelV2Inst.accountsView.accounts) {
|
||||
// return;
|
||||
// }
|
||||
// root.selectedAccount = newIndex;
|
||||
// root.walletModelV2Inst.setCurrentAccountByIndex(newIndex);
|
||||
}
|
||||
|
||||
function afterAddAccount() {
|
||||
// Not Refactored Yet
|
||||
// changeSelectedAccount(walletModelInst.accountsView.accounts.rowCount() - 1);
|
||||
}
|
||||
|
||||
function getCollectionMaxValue(traitType, value, maxValue, collectionIndex) {
|
||||
// Not Refactored Yet
|
||||
// if(maxValue !== "")
|
||||
// return parseInt(value) + qsTr(" of ") + maxValue;
|
||||
// else
|
||||
// return parseInt(value) + qsTr(" of ") +
|
||||
// walletModelV2Inst.collectiblesView.collections.getCollectionTraitMaxValue(collectionIndex, traitType).toString();
|
||||
}
|
||||
|
||||
property bool seedPhraseInserted: false
|
||||
property bool isSeedCountValid: false
|
||||
property bool loadingAccounts: false
|
||||
|
||||
function seedPhraseNotFound(text) {
|
||||
// Read above, same story, `validateMnemonic` is method of AccountService
|
||||
// in wallet section we need to deal with it via walletModule, not anything
|
||||
// related to onboarding.
|
||||
|
||||
// var seedValidationError = root.onboardingModelInst.validateMnemonic(text);
|
||||
// var regex = new RegExp('word [a-z]+ not found in the dictionary', 'i');
|
||||
// return regex.test(seedValidationError);
|
||||
|
||||
return ""
|
||||
}
|
||||
|
||||
function validateAddAccountPopup(text, model, keyOrSeedValid, accountNameValid) {
|
||||
if (root.isSeedCountValid && !root.seedPhraseNotFound(text)) {
|
||||
var validCount = 0;
|
||||
for (var i = 0; i < model.count; i++) {
|
||||
if (!!model.itemAtIndex(i) && model.itemAtIndex(i).nameInputValid) {
|
||||
validCount++;
|
||||
}
|
||||
}
|
||||
}
|
||||
return (root.isSeedCountValid && !root.seedPhraseNotFound(text)) ? (validCount === model.count) :
|
||||
(keyOrSeedValid && accountNameValid);
|
||||
}
|
||||
|
||||
function validateTextInput(text) {
|
||||
root.seedPhraseInserted = text.includes(" ");
|
||||
var errorMessage;
|
||||
root.isSeedCountValid = (!!text && (text.match(/(\w+)/g).length === 12));
|
||||
if (text === "") {
|
||||
errorMessage = qsTr("You need to enter a valid private key or seed phrase");
|
||||
} else {
|
||||
if (!root.seedPhraseInserted) {
|
||||
errorMessage = !Utils.isPrivateKey(text) ?
|
||||
qsTrId("enter-a-valid-private-key-(64-characters-hexadecimal-string)") : "";
|
||||
} else {
|
||||
if (!root.isSeedCountValid) {
|
||||
errorMessage = qsTrId("enter-a-valid-mnemonic");
|
||||
} else if (root.seedPhraseNotFound(text)) {
|
||||
errorMessage = qsTrId("custom-seed-phrase") + '. ' + qsTrId("custom-seed-phrase-text-1");
|
||||
} else {
|
||||
errorMessage = "";
|
||||
}
|
||||
}
|
||||
}
|
||||
return errorMessage;
|
||||
}
|
||||
|
||||
function addAccount(text, model, keyOrSeedValid, accountNameInput) {
|
||||
// Not Refactored Yet
|
||||
// root.loadingAccounts = true;
|
||||
// if (!root.validateAddAccountPopup(text, model, keyOrSeedValid, accountNameInput.nameInputValid)) {
|
||||
// Global.playErrorSound();
|
||||
// root.loadingAccounts = false;
|
||||
// } else {
|
||||
// //TODO account color to be verified with design
|
||||
// var result;
|
||||
// if (root.isSeedCountValid && !root.seedPhraseNotFound(text)) {
|
||||
// for (var i = 0; i < model.count; i++) {
|
||||
// //TODO add authorization process when Authorization moadl is ready
|
||||
// if (!!model.itemAtIndex(i)) {
|
||||
// result = root.walletModelInst.accountsView.addAccountsFromSeed(model.itemAtIndex(i).accountAddress, "qwqwqw", model.itemAtIndex(i).accountName, "")
|
||||
// }
|
||||
// }
|
||||
// } else {
|
||||
// result = root.walletModelInst.accountsView.addAccountsFromPrivateKey(text, "qwqwqw", accountNameInput.text, "");
|
||||
// }
|
||||
// root.loadingAccounts = false;
|
||||
// if (result) {
|
||||
// let resultJson = JSON.parse(result);
|
||||
// if (!Utils.isInvalidPasswordMessage(resultJson.error)) {
|
||||
// accountError.text = resultJson.error;
|
||||
// accountError.open();
|
||||
// }
|
||||
// Global.playErrorSound();
|
||||
// return;
|
||||
// }
|
||||
// }
|
||||
}
|
||||
|
||||
property MessageDialog accountError: MessageDialog {
|
||||
id: accountError
|
||||
title: qsTr("Adding the account failed")
|
||||
icon: StandardIcon.Critical
|
||||
standardButtons: StandardButton.Ok
|
||||
}
|
||||
|
||||
function deleteAccount(address) {
|
||||
// Not Refactored Yet
|
||||
// walletModelInst.accountsView.deleteAccount(address);
|
||||
}
|
||||
|
||||
property ListModel exampleWalletModel: ListModel {
|
||||
id: exampleWalletModel
|
||||
ListElement {
|
||||
name: "Status account"
|
||||
address: "0xcfc9f08bbcbcb80760e8cb9a3c1232d19662fc6f"
|
||||
isFavorite: false
|
||||
}
|
||||
ListElement {
|
||||
name: "Test account 1"
|
||||
address: "0x2Ef1...E0Ba"
|
||||
isFavorite: false
|
||||
}
|
||||
ListElement {
|
||||
name: "Status account 2"
|
||||
address: "0x2Ef1...E0Ba"
|
||||
isFavorite: true
|
||||
}
|
||||
ListElement {
|
||||
name: "Status account"
|
||||
address: "0xcfc9f08bbcbcb80760e8cb9a3c1232d19662fc6f"
|
||||
isFavorite: false
|
||||
}
|
||||
ListElement {
|
||||
name: "Test account 1"
|
||||
address: "0x2Ef1...E0Ba"
|
||||
isFavorite: false
|
||||
}
|
||||
ListElement {
|
||||
name: "Status account 2"
|
||||
address: "0x2Ef1...E0Ba"
|
||||
isFavorite: true
|
||||
}
|
||||
ListElement {
|
||||
name: "Status account"
|
||||
address: "0xcfc9f08bbcbcb80760e8cb9a3c1232d19662fc6f"
|
||||
isFavorite: false
|
||||
}
|
||||
ListElement {
|
||||
name: "Test account 1"
|
||||
address: "0x2Ef1...E0Ba"
|
||||
isFavorite: false
|
||||
}
|
||||
ListElement {
|
||||
name: "Status account 2"
|
||||
address: "0x2Ef1...E0Ba"
|
||||
isFavorite: true
|
||||
}
|
||||
ListElement {
|
||||
name: "Status account"
|
||||
address: "0xcfc9f08bbcbcb80760e8cb9a3c1232d19662fc6f"
|
||||
isFavorite: false
|
||||
}
|
||||
ListElement {
|
||||
name: "Test account 1"
|
||||
address: "0x2Ef1...E0Ba"
|
||||
isFavorite: false
|
||||
}
|
||||
ListElement {
|
||||
name: "Status account 2"
|
||||
address: "0x2Ef1...E0Ba"
|
||||
isFavorite: true
|
||||
}
|
||||
}
|
||||
}
|
|
@ -1,14 +0,0 @@
|
|||
import QtQuick 2.13
|
||||
|
||||
import StatusQ.Core 0.1
|
||||
import StatusQ.Core.Theme 0.1
|
||||
|
||||
Item {
|
||||
id: root
|
||||
StatusBaseText {
|
||||
anchors.centerIn: parent
|
||||
color: Theme.palette.baseColor1
|
||||
text: qsTr("Activity will appear here")
|
||||
font.pixelSize: 15
|
||||
}
|
||||
}
|
|
@ -1,88 +0,0 @@
|
|||
import QtQuick 2.13
|
||||
import QtQuick.Controls 2.13
|
||||
import StatusQ.Controls 0.1
|
||||
import shared 1.0
|
||||
import shared.popups 1.0
|
||||
import shared.status 1.0
|
||||
|
||||
import utils 1.0
|
||||
|
||||
import "../popups"
|
||||
|
||||
StatusFlatButton {
|
||||
id: btnAdd
|
||||
width: 138
|
||||
height: 38
|
||||
size: StatusBaseButton.Size.Small
|
||||
text: qsTr("Add account")
|
||||
icon.name: "add"
|
||||
icon.width: 14
|
||||
icon.height: 14
|
||||
property var store
|
||||
|
||||
onClicked: {
|
||||
if (newAccountMenu.opened) {
|
||||
newAccountMenu.close();
|
||||
} else {
|
||||
newAccountMenu.popup(0, btnAdd.height + 4);
|
||||
}
|
||||
}
|
||||
|
||||
// TODO: replace with StatusPopupMenu
|
||||
PopupMenu {
|
||||
id: newAccountMenu
|
||||
width: 260
|
||||
closePolicy: Popup.CloseOnEscape | Popup.CloseOnPressOutsideParent
|
||||
Action {
|
||||
icon.width: 19
|
||||
icon.height: 19
|
||||
icon.source: Style.svg("generate_account")
|
||||
text: qsTrId("generate-a-new-account")
|
||||
onTriggered: { console.log("TODO"); }
|
||||
}
|
||||
Action {
|
||||
icon.width: 19
|
||||
icon.height: 19
|
||||
icon.source: Style.svg("eye")
|
||||
text: qsTrId("add-a-watch-account")
|
||||
onTriggered: { console.log("TODO"); }
|
||||
}
|
||||
Action {
|
||||
text: qsTr("Add with key or seed phrase")
|
||||
icon.source: Style.svg("enter_private_key")
|
||||
icon.width: 19
|
||||
icon.height: 19
|
||||
onTriggered: {
|
||||
addAccountPopupLoader.active = !addAccountPopupLoader.active;
|
||||
}
|
||||
}
|
||||
onAboutToShow: {
|
||||
btnAdd.state = "pressed";
|
||||
}
|
||||
|
||||
onAboutToHide: {
|
||||
btnAdd.state = "default";
|
||||
}
|
||||
}
|
||||
|
||||
Loader {
|
||||
id: addAccountPopupLoader
|
||||
active: false
|
||||
sourceComponent: AddAccountPopup {
|
||||
id: addAccountPopup
|
||||
anchors.centerIn: parent
|
||||
store: btnAdd.store
|
||||
onAddAccountClicked: {
|
||||
btnAdd.store.afterAddAccount();
|
||||
}
|
||||
onClosed: {
|
||||
addAccountPopupLoader.active = false;
|
||||
}
|
||||
}
|
||||
onLoaded: {
|
||||
if (status === Loader.Ready) {
|
||||
item.open();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
|
@ -1,115 +0,0 @@
|
|||
import QtQuick 2.13
|
||||
import QtQuick.Layouts 1.3
|
||||
import QtQuick.Controls 2.14
|
||||
|
||||
import utils 1.0
|
||||
import shared 1.0
|
||||
import StatusQ.Core 0.1
|
||||
|
||||
Item {
|
||||
id: root
|
||||
signal assetClicked(string name)
|
||||
|
||||
Component {
|
||||
id: assetViewDelegate
|
||||
|
||||
Item {
|
||||
id: element
|
||||
anchors.right: parent.right
|
||||
anchors.left: parent.left
|
||||
height: 40
|
||||
|
||||
Image {
|
||||
id: assetInfoImage
|
||||
width: 36
|
||||
height: 36
|
||||
source: symbol ? Style.png("tokens/" + symbol) : ""
|
||||
anchors.left: parent.left
|
||||
anchors.leftMargin: 0
|
||||
anchors.verticalCenter: parent.verticalCenter
|
||||
onStatusChanged: {
|
||||
if (assetInfoImage.status == Image.Error) {
|
||||
assetInfoImage.source = Style.png("tokens/DEFAULT-TOKEN@3x")
|
||||
}
|
||||
}
|
||||
}
|
||||
StatusBaseText {
|
||||
id: assetSymbol
|
||||
text: symbol
|
||||
anchors.left: assetInfoImage.right
|
||||
anchors.leftMargin: Style.current.smallPadding
|
||||
anchors.top: assetInfoImage.top
|
||||
anchors.topMargin: 0
|
||||
font.pixelSize: 15
|
||||
}
|
||||
StatusBaseText {
|
||||
id: assetFullTokenName
|
||||
text: name
|
||||
anchors.bottom: parent.bottom
|
||||
anchors.bottomMargin: 0
|
||||
anchors.left: assetInfoImage.right
|
||||
anchors.leftMargin: Style.current.smallPadding
|
||||
color: Style.current.secondaryText
|
||||
font.pixelSize: 15
|
||||
}
|
||||
StatusBaseText {
|
||||
id: assetValue
|
||||
text: value.toUpperCase() + " " + symbol
|
||||
anchors.right: parent.right
|
||||
anchors.rightMargin: 0
|
||||
font.pixelSize: 15
|
||||
font.strikeout: false
|
||||
}
|
||||
StatusBaseText {
|
||||
id: assetFiatValue
|
||||
color: Style.current.secondaryText
|
||||
// Not Refactored Yet
|
||||
// text: Utils.toLocaleString(fiatBalance, localAppSettings.locale) + " " + walletModel.balanceView.defaultCurrency.toUpperCase()
|
||||
anchors.right: parent.right
|
||||
anchors.rightMargin: 0
|
||||
anchors.bottom: parent.bottom
|
||||
anchors.bottomMargin: 0
|
||||
font.pixelSize: 15
|
||||
}
|
||||
MouseArea {
|
||||
anchors.fill: parent
|
||||
cursorShape: Qt.PointingHandCursor
|
||||
onClicked: {
|
||||
root.assetClicked(name);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
ListModel {
|
||||
id: exampleModel
|
||||
ListElement {
|
||||
name: "test"
|
||||
fiatBalance: "2000 USD"
|
||||
value: "123 USD"
|
||||
symbol: "ETH"
|
||||
fullTokenName: "Ethereum"
|
||||
fiatBalanceDisplay: "3423 ETH"
|
||||
image: "token-icons/eth"
|
||||
}
|
||||
}
|
||||
|
||||
ScrollView {
|
||||
anchors.fill: parent
|
||||
Layout.fillWidth: true
|
||||
Layout.fillHeight: true
|
||||
ScrollBar.horizontal.policy: ScrollBar.AlwaysOff
|
||||
ScrollBar.vertical.policy: assetListView.contentHeight > assetListView.height ? ScrollBar.AlwaysOn : ScrollBar.AlwaysOff
|
||||
|
||||
ListView {
|
||||
id: assetListView
|
||||
spacing: Style.current.padding * 2
|
||||
anchors.fill: parent
|
||||
//model: exampleModel
|
||||
// Not Refactored Yet
|
||||
// model: walletModel.tokensView.assets
|
||||
delegate: assetViewDelegate
|
||||
boundsBehavior: Flickable.StopAtBounds
|
||||
}
|
||||
}
|
||||
}
|
|
@ -1,102 +0,0 @@
|
|||
import QtQuick 2.13
|
||||
import QtQuick.Controls 2.13
|
||||
import QtGraphicalEffects 1.13
|
||||
|
||||
import StatusQ.Components 0.1
|
||||
|
||||
import utils 1.0
|
||||
import shared.panels 1.0
|
||||
|
||||
import "../popups"
|
||||
import "collectibles"
|
||||
|
||||
import StatusQ.Components 0.1
|
||||
|
||||
Item {
|
||||
id: root
|
||||
width: parent.width
|
||||
property var store
|
||||
signal collectibleClicked()
|
||||
|
||||
Loader {
|
||||
id: contentLoader
|
||||
width: parent.width
|
||||
height: parent.height
|
||||
|
||||
sourceComponent: {
|
||||
// Not Refactored Yet
|
||||
// if (root.store.walletModelV2Inst.collectiblesView.isLoading) {
|
||||
// return loading;
|
||||
// }
|
||||
// if (root.store.walletModelV2Inst.collectiblesView.collections.rowCount() === 0) {
|
||||
// return empty;
|
||||
// }
|
||||
return loaded;
|
||||
}
|
||||
}
|
||||
|
||||
Component {
|
||||
id: loading
|
||||
Item {
|
||||
StatusLoadingIndicator {
|
||||
width: 20
|
||||
height: 20
|
||||
anchors.verticalCenter: parent.verticalCenter
|
||||
anchors.horizontalCenter: parent.horizontalCenter
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Component {
|
||||
id: empty
|
||||
Item {
|
||||
StyledText {
|
||||
anchors.verticalCenter: parent.verticalCenter
|
||||
anchors.horizontalCenter: parent.horizontalCenter
|
||||
color: Style.current.secondaryText
|
||||
text: qsTr("Collectibles will appear here")
|
||||
font.pixelSize: 15
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Component {
|
||||
id: loaded
|
||||
|
||||
ScrollView {
|
||||
id: scrollView
|
||||
clip: true
|
||||
|
||||
Column {
|
||||
id: collectiblesSection
|
||||
width: parent.width
|
||||
|
||||
Repeater {
|
||||
id: collectionsRepeater
|
||||
// Not Refactored Yet
|
||||
// model: root.store.walletModelV2Inst.collectiblesView.collections
|
||||
//model: 5
|
||||
delegate: StatusExpandableItem {
|
||||
width: parent.width - 156
|
||||
anchors.horizontalCenter: parent.horizontalCenter
|
||||
|
||||
primaryText: model.name
|
||||
image.source: model.imageUrl
|
||||
type: StatusExpandableItem.Type.Secondary
|
||||
expandableComponent: CollectibleCollectionView {
|
||||
store: root.store
|
||||
slug: model.slug
|
||||
anchors.left: parent.left
|
||||
anchors.leftMargin: Style.current.bigPadding
|
||||
anchors.right: parent.right
|
||||
anchors.rightMargin: Style.current.bigPadding
|
||||
onCollectibleClicked: {
|
||||
root.collectibleClicked();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
|
@ -1,279 +0,0 @@
|
|||
import QtQuick 2.13
|
||||
import QtQuick.Controls 2.13
|
||||
import QtQuick.Layouts 1.13
|
||||
import QtGraphicalEffects 1.13
|
||||
import StatusQ.Components 0.1
|
||||
import StatusQ.Core 0.1
|
||||
import StatusQ.Core.Theme 0.1
|
||||
|
||||
import utils 1.0
|
||||
import shared 1.0
|
||||
import shared.panels 1.0
|
||||
import shared.controls 1.0
|
||||
|
||||
Rectangle {
|
||||
id: walletInfoContainer
|
||||
color: Style.current.secondaryMenuBackground
|
||||
|
||||
property var store
|
||||
signal savedAddressesClicked(bool selected)
|
||||
|
||||
StyledText {
|
||||
id: title
|
||||
anchors.top: parent.top
|
||||
anchors.topMargin: Style.current.padding
|
||||
anchors.horizontalCenter: parent.horizontalCenter
|
||||
font.weight: Font.Bold
|
||||
font.pixelSize: 17
|
||||
text: qsTrId("wallet")
|
||||
}
|
||||
|
||||
Item {
|
||||
id: walletValueTextContainer
|
||||
anchors.left: parent.left
|
||||
anchors.leftMargin: Style.current.padding
|
||||
anchors.right: parent.right
|
||||
anchors.rightMargin: Style.current.padding
|
||||
anchors.top: title.bottom
|
||||
anchors.topMargin: Style.current.padding
|
||||
height: childrenRect.height
|
||||
|
||||
StyledTextEdit {
|
||||
id: walletAmountValue
|
||||
color: Style.current.textColor
|
||||
selectByMouse: true
|
||||
cursorVisible: true
|
||||
readOnly: true
|
||||
anchors.left: parent.left
|
||||
font.weight: Font.Medium
|
||||
font.pixelSize: 30
|
||||
//TOOD improve this to not use dynamic scoping
|
||||
text: Utils.toLocaleString("0.00", localAppSettings.locale, {"currency": true}) + " " + "USD"
|
||||
}
|
||||
|
||||
StyledText {
|
||||
id: totalValue
|
||||
color: Style.current.secondaryText
|
||||
text: qsTrId("wallet-total-value")
|
||||
anchors.left: walletAmountValue.left
|
||||
anchors.top: walletAmountValue.bottom
|
||||
font.weight: Font.Medium
|
||||
font.pixelSize: 13
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Component {
|
||||
id: walletDelegate
|
||||
|
||||
Rectangle {
|
||||
id: rectangle
|
||||
anchors.left: parent.left
|
||||
anchors.leftMargin: Style.current.padding
|
||||
anchors.right: parent.right
|
||||
anchors.rightMargin: Style.current.padding
|
||||
height: 64
|
||||
property bool selected: (index === walletInfoContainer.store.selectedAccount)
|
||||
property bool hovered
|
||||
color: selected ? Style.current.menuBackgroundActive :
|
||||
hovered ? Style.current.backgroundHoverLight
|
||||
: Style.current.transparent
|
||||
radius: Style.current.radius
|
||||
|
||||
SVGImage {
|
||||
id: walletIcon
|
||||
width: 12
|
||||
height: 12
|
||||
anchors.top: parent.top
|
||||
anchors.topMargin: Style.current.smallPadding
|
||||
anchors.left: parent.left
|
||||
anchors.leftMargin: Style.current.padding
|
||||
source: Style.svg("walletIcon")
|
||||
}
|
||||
ColorOverlay {
|
||||
anchors.fill: walletIcon
|
||||
source: walletIcon
|
||||
color: Utils.getCurrentThemeAccountColor(iconColor) || Style.current.accountColors[0]
|
||||
}
|
||||
StyledText {
|
||||
id: walletName
|
||||
elide: Text.ElideRight
|
||||
anchors.right: walletBalance.left
|
||||
anchors.rightMargin: Style.current.smallPadding
|
||||
anchors.top: parent.top
|
||||
anchors.topMargin: Style.current.smallPadding
|
||||
anchors.left: walletIcon.right
|
||||
anchors.leftMargin: Style.current.smallPadding
|
||||
|
||||
font.pixelSize: 15
|
||||
font.weight: Font.Medium
|
||||
color: Style.current.textColor
|
||||
text: name
|
||||
}
|
||||
StyledText {
|
||||
id: walletAddress
|
||||
font.family: Style.current.fontHexRegular.name
|
||||
anchors.right: parent.right
|
||||
anchors.rightMargin: parent.width/2
|
||||
elide: Text.ElideMiddle
|
||||
anchors.bottom: parent.bottom
|
||||
anchors.bottomMargin: Style.current.smallPadding
|
||||
anchors.left: walletIcon.left
|
||||
font.pixelSize: 15
|
||||
font.weight: Font.Medium
|
||||
color: Style.current.secondaryText
|
||||
opacity: selected ? 0.7 : 1
|
||||
text: address
|
||||
}
|
||||
StyledText {
|
||||
id: walletBalance
|
||||
anchors.top: parent.top
|
||||
anchors.topMargin: Style.current.smallPadding
|
||||
anchors.right: parent.right
|
||||
anchors.rightMargin: Style.current.padding
|
||||
font.pixelSize: 15
|
||||
font.weight: Font.Medium
|
||||
color: Style.current.textColor
|
||||
text: isLoading ? "..." : Utils.toLocaleString(fiatBalance, localAppSettings.locale, {"currency": true}) + " " + "USD"
|
||||
}
|
||||
MouseArea {
|
||||
anchors.fill: parent
|
||||
hoverEnabled: true
|
||||
cursorShape: Qt.PointingHandCursor
|
||||
onEntered: {
|
||||
rectangle.hovered = true;
|
||||
}
|
||||
onExited: {
|
||||
rectangle.hovered = false;
|
||||
}
|
||||
onClicked: {
|
||||
walletInfoContainer.store.changeSelectedAccount(index);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
ScrollView {
|
||||
id: accountsList
|
||||
anchors.right: parent.right
|
||||
anchors.left: parent.left
|
||||
height: (listView.count <= 8) ? ((listView.count * 64) + (Style.current.padding * 2)) : 530
|
||||
anchors.top: walletValueTextContainer.bottom
|
||||
anchors.topMargin: Style.current.padding
|
||||
ScrollBar.horizontal.policy: ScrollBar.AlwaysOff
|
||||
ScrollBar.vertical.policy: listView.contentHeight > listView.height ? ScrollBar.AlwaysOn : ScrollBar.AlwaysOff
|
||||
|
||||
ListView {
|
||||
id: listView
|
||||
clip: true
|
||||
anchors.fill: parent
|
||||
spacing: 5
|
||||
boundsBehavior: Flickable.StopAtBounds
|
||||
// Not Refactored Yet
|
||||
// model: walletInfoContainer.store.walletModelV2Inst.accountsView.accounts
|
||||
delegate: walletDelegate
|
||||
ListModel {
|
||||
id: exampleWalletModel
|
||||
ListElement {
|
||||
name: "Status account"
|
||||
address: "0xcfc9f08bbcbcb80760e8cb9a3c1232d19662fc6f"
|
||||
balance: "12.00 USD"
|
||||
iconColor: "#7CDA00"
|
||||
}
|
||||
|
||||
ListElement {
|
||||
name: "Test account 1"
|
||||
address: "0x2Ef1...E0Ba"
|
||||
balance: "12.00 USD"
|
||||
iconColor: "#FA6565"
|
||||
}
|
||||
ListElement {
|
||||
name: "Status account"
|
||||
address: "0x2Ef1...E0Ba"
|
||||
balance: "12.00 USD"
|
||||
iconColor: "#7CDA00"
|
||||
}
|
||||
ListElement {
|
||||
name: "Status account"
|
||||
address: "0xcfc9f08bbcbcb80760e8cb9a3c1232d19662fc6f"
|
||||
balance: "12.00 USD"
|
||||
iconColor: "#7CDA00"
|
||||
}
|
||||
|
||||
ListElement {
|
||||
name: "Test account 1"
|
||||
address: "0x2Ef1...E0Ba"
|
||||
balance: "12.00 USD"
|
||||
iconColor: "#FA6565"
|
||||
}
|
||||
ListElement {
|
||||
name: "Status account"
|
||||
address: "0x2Ef1...E0Ba"
|
||||
balance: "12.00 USD"
|
||||
iconColor: "#7CDA00"
|
||||
}
|
||||
ListElement {
|
||||
name: "Status account"
|
||||
address: "0xcfc9f08bbcbcb80760e8cb9a3c1232d19662fc6f"
|
||||
balance: "12.00 USD"
|
||||
iconColor: "#7CDA00"
|
||||
}
|
||||
|
||||
ListElement {
|
||||
name: "Test account 1"
|
||||
address: "0x2Ef1...E0Ba"
|
||||
balance: "12.00 USD"
|
||||
iconColor: "#FA6565"
|
||||
}
|
||||
ListElement {
|
||||
name: "Status account"
|
||||
address: "0x2Ef1...E0Ba"
|
||||
balance: "12.00 USD"
|
||||
iconColor: "#7CDA00"
|
||||
}
|
||||
ListElement {
|
||||
name: "Status account"
|
||||
address: "0xcfc9f08bbcbcb80760e8cb9a3c1232d19662fc6f"
|
||||
balance: "12.00 USD"
|
||||
iconColor: "#7CDA00"
|
||||
}
|
||||
|
||||
ListElement {
|
||||
name: "Test account 1"
|
||||
address: "0x2Ef1...E0Ba"
|
||||
balance: "12.00 USD"
|
||||
iconColor: "#FA6565"
|
||||
}
|
||||
ListElement {
|
||||
name: "Status account 12"
|
||||
address: "0x2Ef1...E0Ba"
|
||||
balance: "12.00 USD"
|
||||
iconColor: "#7CDA00"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
AddAccountView {
|
||||
id: addAccountButton
|
||||
anchors.left: parent.left
|
||||
anchors.leftMargin: Style.current.padding
|
||||
anchors.top: accountsList.bottom
|
||||
anchors.topMargin: 31
|
||||
store: walletInfoContainer.store
|
||||
}
|
||||
StatusNavigationListItem {
|
||||
id: btnSavedAddresses
|
||||
title: qsTr("Saved addresses")
|
||||
icon.name: "address"
|
||||
anchors.bottom: parent.bottom
|
||||
anchors.left: parent.left
|
||||
anchors.bottomMargin: Style.current.halfPadding
|
||||
anchors.leftMargin: Style.current.smallPadding
|
||||
|
||||
onClicked: {
|
||||
selected = !selected;
|
||||
walletInfoContainer.savedAddressesClicked(selected);
|
||||
}
|
||||
}
|
||||
}
|
|
@ -1,14 +0,0 @@
|
|||
import QtQuick 2.13
|
||||
|
||||
import StatusQ.Core 0.1
|
||||
import StatusQ.Core.Theme 0.1
|
||||
|
||||
Item {
|
||||
id: root
|
||||
StatusBaseText {
|
||||
anchors.centerIn: parent
|
||||
color: Theme.palette.baseColor1
|
||||
text: qsTr("Positions will appear here")
|
||||
font.pixelSize: 15
|
||||
}
|
||||
}
|
|
@ -1,274 +0,0 @@
|
|||
import QtQuick 2.13
|
||||
import QtQuick.Controls 2.13
|
||||
import QtQuick.Layouts 1.13
|
||||
|
||||
|
||||
import utils 1.0
|
||||
|
||||
import StatusQ.Controls 0.1
|
||||
import StatusQ.Components 0.1
|
||||
import StatusQ.Core 0.1
|
||||
import StatusQ.Core.Theme 0.1
|
||||
import StatusQ.Popups 0.1
|
||||
|
||||
import "../popups"
|
||||
import "../controls"
|
||||
|
||||
Item {
|
||||
id: root
|
||||
property bool loading: false
|
||||
property int error: SavedAddressesView.Error.None
|
||||
anchors.leftMargin: 80
|
||||
anchors.rightMargin: 80
|
||||
anchors.topMargin: 62
|
||||
property var store
|
||||
|
||||
enum Error {
|
||||
CreateSavedAddressError,
|
||||
DeleteSavedAddressError,
|
||||
ParseAddressError,
|
||||
ReadSavedAddressesError,
|
||||
UpdateSavedAddressError,
|
||||
None
|
||||
}
|
||||
|
||||
Item {
|
||||
id: header
|
||||
anchors.left: parent.left
|
||||
anchors.right: parent.right
|
||||
anchors.top: parent.top
|
||||
height: btnAdd.height
|
||||
|
||||
Row {
|
||||
anchors.left: parent.left
|
||||
anchors.top: parent.top
|
||||
anchors.right: btnAdd.left
|
||||
spacing: 10
|
||||
|
||||
StatusIcon {
|
||||
icon: "address"
|
||||
color: Theme.palette.primaryColor1
|
||||
width: undefined
|
||||
height: 35
|
||||
anchors.verticalCenter: parent.verticalCenter
|
||||
}
|
||||
StatusBaseText {
|
||||
id: title
|
||||
text: qsTr("Saved addresses")
|
||||
font.weight: Font.Medium
|
||||
font.pixelSize: 28
|
||||
anchors.verticalCenter: parent.verticalCenter
|
||||
color: Theme.palette.directColor1
|
||||
}
|
||||
}
|
||||
Component {
|
||||
id: addEditSavedAddress
|
||||
AddEditSavedAddressPopup {
|
||||
id: addEditModal
|
||||
anchors.centerIn: parent
|
||||
store: root.store
|
||||
onClosed: {
|
||||
destroy();
|
||||
}
|
||||
onBeforeSave: {
|
||||
root.loading = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
StatusButton {
|
||||
id: btnAdd
|
||||
anchors.right: parent.right
|
||||
anchors.top: parent.top
|
||||
text: "Add new +"
|
||||
leftPadding: 8
|
||||
rightPadding: 11
|
||||
visible: !root.loading
|
||||
onClicked: {
|
||||
Global.openPopup(addEditSavedAddress)
|
||||
}
|
||||
}
|
||||
StatusLoadingIndicator {
|
||||
anchors.centerIn: parent
|
||||
visible: root.loading
|
||||
color: Theme.palette.directColor4
|
||||
}
|
||||
}
|
||||
|
||||
Component {
|
||||
id: delegateSavedAddress
|
||||
StatusListItem {
|
||||
id: savedAddress
|
||||
title: name
|
||||
subTitle: address
|
||||
icon.name: "wallet"
|
||||
implicitWidth: parent.width
|
||||
property bool showButtons: sensor.containsMouse
|
||||
components: [
|
||||
StatusRoundButton {
|
||||
color: hovered ? Theme.palette.dangerColor2 : Theme.palette.dangerColor3
|
||||
icon.color: Theme.palette.dangerColor1
|
||||
visible: showButtons
|
||||
icon.name: "delete"
|
||||
onClicked: {
|
||||
deleteAddressConfirm.name = name
|
||||
deleteAddressConfirm.address = address
|
||||
deleteAddressConfirm.open()
|
||||
}
|
||||
},
|
||||
StatusRoundButton {
|
||||
icon.name: "pencil"
|
||||
visible: showButtons
|
||||
onClicked: Global.openPopup(addEditSavedAddress,
|
||||
{
|
||||
edit: true,
|
||||
address: address,
|
||||
name: name
|
||||
})
|
||||
},
|
||||
StatusRoundButton {
|
||||
icon.name: "send"
|
||||
visible: showButtons
|
||||
},
|
||||
StatusRoundButton {
|
||||
color: hovered ? Theme.palette.pinColor2 : Theme.palette.pinColor3
|
||||
icon.color: Theme.palette.pinColor1
|
||||
icon.name: "favourite"
|
||||
visible: showButtons
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
|
||||
StatusModal {
|
||||
id: deleteAddressConfirm
|
||||
property string address
|
||||
property string name
|
||||
// NOTE: the `text` property was created as a workaround because
|
||||
// setting StatusBaseText.text to `qsTr("...").arg("...")`
|
||||
// caused no text to render
|
||||
property string text: qsTr("Are you sure you want to remove '%1' from your saved addresses?").arg(name)
|
||||
anchors.centerIn: parent
|
||||
header.title: "Are you sure?"
|
||||
header.subTitle: name
|
||||
contentItem: StatusBaseText {
|
||||
anchors.centerIn: parent
|
||||
height: contentHeight + topPadding + bottomPadding
|
||||
text: deleteAddressConfirm.text
|
||||
font.pixelSize: 15
|
||||
color: Theme.palette.directColor1
|
||||
wrapMode: Text.Wrap
|
||||
topPadding: Style.current.padding
|
||||
rightPadding: Style.current.padding
|
||||
bottomPadding: Style.current.padding
|
||||
leftPadding: Style.current.padding
|
||||
}
|
||||
rightButtons: [
|
||||
StatusButton {
|
||||
text: qsTr("Cancel")
|
||||
onClicked: deleteAddressConfirm.close()
|
||||
},
|
||||
StatusButton {
|
||||
type: StatusBaseButton.Type.Danger
|
||||
text: qsTr("Delete")
|
||||
onClicked: {
|
||||
// Not Refactored Yet
|
||||
// root.loading = true
|
||||
// root.store.walletModelV2Inst.savedAddressesView.deleteSavedAddress(
|
||||
// deleteAddressConfirm.address)
|
||||
// deleteAddressConfirm.close()
|
||||
}
|
||||
}
|
||||
]
|
||||
|
||||
}
|
||||
// Not Refactored Yet
|
||||
// Connections {
|
||||
// target: root.store.walletModelV2Inst.savedAddressesView
|
||||
// onAddEditResultChanged: {
|
||||
// root.loading = false
|
||||
// let resultRaw = root.store.walletModelV2Inst.savedAddressesView.addEditResult
|
||||
// let result = JSON.parse(resultRaw)
|
||||
// if (result.o) {
|
||||
// root.error = SavedAddressesView.Error.None
|
||||
// root.store.walletModelV2Inst.savedAddressesView.loadSavedAddresses();
|
||||
// } else {
|
||||
// root.error = parseInt(result.e)
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
// Not Refactored Yet
|
||||
// Connections {
|
||||
// target: root.store.walletModelV2Inst.savedAddressesView
|
||||
// onDeleteResultChanged: {
|
||||
// root.loading = false
|
||||
// let resultRaw = root.store.walletModelV2Inst.savedAddressesView.deleteResult
|
||||
// let result = JSON.parse(resultRaw)
|
||||
// if (result.o) {
|
||||
// root.error = SavedAddressesView.Error.None
|
||||
// root.store.walletModelV2Inst.savedAddressesView.loadSavedAddresses();
|
||||
// deleteAddressConfirm.close();
|
||||
// } else {
|
||||
// root.error = parseInt(result.e)
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
// Not Refactored Yet
|
||||
// Connections {
|
||||
// target: root.store.walletModelV2Inst.savedAddressesView
|
||||
// onLoadResultChanged: {
|
||||
// root.loading = false
|
||||
// let resultRaw = root.store.walletModelV2Inst.savedAddressesView.loadResult
|
||||
// let result = JSON.parse(resultRaw)
|
||||
// if (result.o) {
|
||||
// root.error = SavedAddressesView.Error.None
|
||||
// } else {
|
||||
// root.error = parseInt(result.e)
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
|
||||
SavedAddressesError {
|
||||
id: errorMessage
|
||||
anchors.top: header.bottom
|
||||
anchors.topMargin: Style.current.padding
|
||||
visible: root.error !== SavedAddressesView.Error.None
|
||||
text: root.store.getSavedAddressErrorText(SavedAddressesView, root.error)
|
||||
height: visible ? 36 : 0
|
||||
}
|
||||
|
||||
StatusBaseText {
|
||||
anchors.top: errorMessage.bottom
|
||||
anchors.topMargin: Style.current.padding
|
||||
anchors.centerIn: parent
|
||||
Layout.fillWidth: true
|
||||
Layout.fillHeight: true
|
||||
visible: listView.count === 0
|
||||
color: Theme.palette.baseColor1
|
||||
text: qsTr("No saved addresses")
|
||||
}
|
||||
|
||||
ScrollView {
|
||||
anchors.top: errorMessage.bottom
|
||||
anchors.topMargin: Style.current.padding
|
||||
anchors.bottom: parent.bottom
|
||||
anchors.bottomMargin: Style.current.halfPadding
|
||||
anchors.right: parent.right
|
||||
anchors.left: parent.left
|
||||
visible: listView.count > 0
|
||||
Layout.fillWidth: true
|
||||
Layout.fillHeight: true
|
||||
ScrollBar.horizontal.policy: ScrollBar.AlwaysOff
|
||||
|
||||
ListView {
|
||||
id: listView
|
||||
//model: root.store.exampleWalletModel
|
||||
// Not Refactored Yet
|
||||
// model: root.store.walletModelV2Inst.savedAddressesView.savedAddresses
|
||||
clip: true
|
||||
spacing: 5
|
||||
anchors.fill: parent
|
||||
boundsBehavior: Flickable.StopAtBounds
|
||||
delegate: delegateSavedAddress
|
||||
}
|
||||
}
|
||||
}
|
|
@ -1,116 +0,0 @@
|
|||
import QtQuick 2.13
|
||||
|
||||
import utils 1.0
|
||||
import shared.controls 1.0
|
||||
|
||||
import "../panels"
|
||||
import "../controls"
|
||||
|
||||
import StatusQ.Core 0.1
|
||||
import StatusQ.Core.Theme 0.1
|
||||
import StatusQ.Components 0.1
|
||||
import StatusQ.Controls 0.1
|
||||
import StatusQ.Controls.Validators 0.1
|
||||
|
||||
Item {
|
||||
id: root
|
||||
visible: (opacity > 0.1)
|
||||
property bool searching: false
|
||||
property alias activeAccountsList: activeAccountsView
|
||||
property Timer timer: Timer {
|
||||
interval: 800
|
||||
onTriggered: {
|
||||
searching = false;
|
||||
}
|
||||
}
|
||||
property var store
|
||||
property var dummyModel: []
|
||||
|
||||
Column {
|
||||
id: searchingColumn
|
||||
width: parent.width
|
||||
height: 80
|
||||
anchors.verticalCenter: parent.verticalCenter
|
||||
spacing: 15
|
||||
StatusLoadingIndicator {
|
||||
anchors.horizontalCenter: parent.horizontalCenter
|
||||
color: Theme.palette.primaryColor1
|
||||
}
|
||||
StatusBaseText {
|
||||
anchors.horizontalCenter: parent.horizontalCenter
|
||||
font.pixelSize: 15
|
||||
text: qsTr("Searching for active accounts")
|
||||
color: Theme.palette.baseColor1
|
||||
}
|
||||
}
|
||||
|
||||
ListView {
|
||||
id: activeAccountsView
|
||||
anchors.fill: parent
|
||||
anchors.bottomMargin: 10
|
||||
clip: true
|
||||
//TODO replace with active accounts model
|
||||
// Not Refactored Yet
|
||||
// model: root.store.walletModelInst.accountsView.accounts
|
||||
delegate: SeedAccountDetailsDelegate {
|
||||
deleteButtonVisible: (activeAccountsView.count > 1)
|
||||
onDeleteClicked: {
|
||||
root.store.deleteAccount(address);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
AccountNotFoundPanel {
|
||||
id: accountNotFound
|
||||
width: parent.width
|
||||
anchors.verticalCenter: parent.verticalCenter
|
||||
}
|
||||
|
||||
states: [
|
||||
State {
|
||||
when: searching
|
||||
PropertyChanges {
|
||||
target: searchingColumn
|
||||
opacity: 1.0
|
||||
}
|
||||
PropertyChanges {
|
||||
target: activeAccountsView
|
||||
opacity: 0.0
|
||||
}
|
||||
PropertyChanges {
|
||||
target: accountNotFound
|
||||
opacity: 0.0
|
||||
}
|
||||
},
|
||||
State {
|
||||
when: !searching
|
||||
PropertyChanges {
|
||||
target: searchingColumn
|
||||
opacity: 0.0
|
||||
}
|
||||
PropertyChanges {
|
||||
target: activeAccountsView
|
||||
opacity: 1.0
|
||||
}
|
||||
PropertyChanges {
|
||||
target: accountNotFound
|
||||
opacity: 0.0
|
||||
}
|
||||
},
|
||||
State {
|
||||
when: (activeAccountsView.count === 0 && !searching)
|
||||
PropertyChanges {
|
||||
target: searchingColumn
|
||||
opacity: 0.0
|
||||
}
|
||||
PropertyChanges {
|
||||
target: activeAccountsView
|
||||
opacity: 0.0
|
||||
}
|
||||
PropertyChanges {
|
||||
target: accountNotFound
|
||||
opacity: 1.0
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
|
@ -1,167 +0,0 @@
|
|||
import QtQuick 2.13
|
||||
import QtGraphicalEffects 1.13
|
||||
|
||||
import StatusQ.Core.Theme 0.1
|
||||
import StatusQ.Components 0.1
|
||||
import StatusQ.Controls 0.1
|
||||
import StatusQ.Core 0.1
|
||||
|
||||
|
||||
import utils 1.0
|
||||
import "../../Profile/Sections"
|
||||
|
||||
Item {
|
||||
id: root
|
||||
property var store
|
||||
|
||||
Column {
|
||||
anchors.top:parent.top
|
||||
leftPadding: 20
|
||||
rightPadding: 20
|
||||
width: parent.width
|
||||
spacing: 12
|
||||
|
||||
StatusExpandableItem {
|
||||
anchors.left: parent.left
|
||||
anchors.leftMargin: 20
|
||||
anchors.right: parent.right
|
||||
anchors.rightMargin: 20
|
||||
|
||||
// Not Refactored Yet
|
||||
// visible : (root.store.walletModelV2Inst.accountsView.currentAccount.walletType !== Constants.seedWalletType) &&
|
||||
// (root.store.walletModelV2Inst.accountsView.currentAccount.walletType !== Constants.watchWalletType) &&
|
||||
// (root.store.walletModelV2Inst.accountsView.currentAccount.walletType !== Constants.keyWalletType)
|
||||
expandable: false
|
||||
icon.name: "seed-phrase"
|
||||
primaryText: qsTr("Back up seed phrase")
|
||||
secondaryText: qsTr("Back up your seed phrase now to secure this account")
|
||||
button.text: qsTr("Back up seed phrase")
|
||||
// Not Refactored Yet (there is no wallet 2 is `base_bc`)
|
||||
// button.enabled: !mnemonicModule.isBackedUp
|
||||
button.onClicked: Global.openBackUpSeedPopup()
|
||||
}
|
||||
|
||||
StatusExpandableItem {
|
||||
anchors.left: parent.left
|
||||
anchors.leftMargin: 20
|
||||
anchors.right: parent.right
|
||||
anchors.rightMargin: 20
|
||||
|
||||
// Not Refactored Yet
|
||||
// visible : root.store.walletModelV2Inst.accountsView.currentAccount.walletType !== Constants.watchWalletType
|
||||
expandable: true
|
||||
icon.name: "secret"
|
||||
primaryText: qsTr("Account signing phrase")
|
||||
secondaryText: qsTr("View your signing phrase and ensure that you never get scammed")
|
||||
expandableComponent: showSigningPhraseExpandableRegion
|
||||
}
|
||||
|
||||
StatusExpandableItem {
|
||||
anchors.left: parent.left
|
||||
anchors.leftMargin: 20
|
||||
anchors.right: parent.right
|
||||
anchors.rightMargin: 20
|
||||
|
||||
// Not Refactored Yet
|
||||
// visible : (root.store.walletModelV2Inst.accountsView.currentAccount.walletType === Constants.keyWalletType) ||
|
||||
// (root.store.walletModelV2Inst.accountsView.currentAccount.walletType === Constants.seedWalletType)
|
||||
expandable: true
|
||||
icon.name: "seed-phrase"
|
||||
primaryText: qsTr("View private key")
|
||||
secondaryText: qsTr("View your seed phrase and ensure it's stored in a safe place")
|
||||
button.text: qsTr("View private key")
|
||||
expandableComponent: notImplemented
|
||||
button.onClicked: {
|
||||
// To-do open enter password Modal
|
||||
expanded = !expanded;
|
||||
}
|
||||
}
|
||||
|
||||
StatusExpandableItem {
|
||||
anchors.left: parent.left
|
||||
anchors.leftMargin: 20
|
||||
anchors.right: parent.right
|
||||
anchors.rightMargin: 20
|
||||
|
||||
expandable: true
|
||||
icon.name: "security"
|
||||
primaryText: qsTr("Security preferences")
|
||||
secondaryText: qsTr("View & set security preferences for this wallet")
|
||||
expandableComponent: notImplemented
|
||||
}
|
||||
}
|
||||
|
||||
Component {
|
||||
id: notImplemented
|
||||
Rectangle {
|
||||
anchors.centerIn: parent
|
||||
width: 654
|
||||
height: infoText.implicitHeight
|
||||
color: Theme.palette.baseColor5
|
||||
StatusBaseText {
|
||||
id: infoText
|
||||
anchors.centerIn: parent
|
||||
color: Theme.palette.directColor4
|
||||
font.pixelSize: 15
|
||||
lineHeight: 22
|
||||
lineHeightMode: Text.FixedHeight
|
||||
font.weight: Font.Medium
|
||||
text: qsTr("Not Implemented")
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Component {
|
||||
id: showSigningPhraseExpandableRegion
|
||||
Row {
|
||||
spacing: 1
|
||||
anchors.centerIn: parent
|
||||
width: 654
|
||||
Rectangle {
|
||||
id: keyRect
|
||||
color: Theme.palette.baseColor5
|
||||
width: Math.min(keyText.implicitWidth, 200) + keyText.anchors.leftMargin + keyText.anchors.rightMargin
|
||||
height: Math.max(keyText.implicitHeight, infoText.implicitHeight) + 42
|
||||
StatusBaseText {
|
||||
id: keyText
|
||||
anchors.verticalCenter: parent.verticalCenter
|
||||
anchors.left: parent.left
|
||||
anchors.leftMargin: 21
|
||||
anchors.right: parent.right
|
||||
anchors.rightMargin: 21
|
||||
width: Math.min(implicitWidth, 200)
|
||||
|
||||
color: Theme.palette.dangerColor1
|
||||
font.pixelSize: 15
|
||||
lineHeight: 22
|
||||
lineHeightMode: Text.FixedHeight
|
||||
elide: Text.ElideRight
|
||||
wrapMode: Text.Wrap
|
||||
// Not Refactored Yet
|
||||
// text: root.store.walletModelV2Inst.settingsView.signingPhrase
|
||||
}
|
||||
}
|
||||
Rectangle {
|
||||
id: infoRect
|
||||
color: Theme.palette.baseColor5
|
||||
width: parent.width - keyRect.width
|
||||
height: Math.max(keyText.implicitHeight, infoText.implicitHeight) + 42
|
||||
StatusBaseText {
|
||||
id: infoText
|
||||
anchors.verticalCenter: parent.verticalCenter
|
||||
anchors.left: parent.left
|
||||
anchors.leftMargin: 25
|
||||
width: 366
|
||||
|
||||
color: Theme.palette.directColor4
|
||||
font.pixelSize: 12
|
||||
lineHeight: 16
|
||||
lineHeightMode: Text.FixedHeight
|
||||
elide: Text.ElideRight
|
||||
wrapMode: Text.Wrap
|
||||
text: qsTr("If you see something different, you should immediately sign out and reinstall Status")
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
|
@ -1,14 +0,0 @@
|
|||
import QtQuick 2.13
|
||||
import QtQuick.Controls 2.13
|
||||
import StatusQ.Controls 0.1
|
||||
|
||||
StackView {
|
||||
id: root
|
||||
|
||||
replaceEnter: Transition {
|
||||
NumberAnimation { property: "opacity"; from: 0; to: 1; duration: 400; easing.type: Easing.OutCubic }
|
||||
}
|
||||
replaceExit: Transition {
|
||||
NumberAnimation { property: "opacity"; from: 1; to: 0; duration: 400; easing.type: Easing.OutCubic }
|
||||
}
|
||||
}
|
|
@ -1,20 +0,0 @@
|
|||
import QtQuick 2.13
|
||||
|
||||
import StatusQ.Controls 0.1
|
||||
import StatusQ.Core 0.1
|
||||
import StatusQ.Core.Theme 0.1
|
||||
|
||||
Item {
|
||||
id: root
|
||||
|
||||
property string backButtonText: ""
|
||||
signal backPressed()
|
||||
|
||||
StatusFlatButton {
|
||||
text: root.backButtonText
|
||||
icon.name: "previous"
|
||||
onClicked: {
|
||||
root.backPressed();
|
||||
}
|
||||
}
|
||||
}
|
|
@ -1,19 +0,0 @@
|
|||
import QtQuick 2.13
|
||||
import QtQuick.Controls 2.12
|
||||
import StatusQ.Core 0.1
|
||||
import StatusQ.Core.Theme 0.1
|
||||
|
||||
import "../"
|
||||
|
||||
StackDetailBase {
|
||||
backButtonText: "Assets"
|
||||
|
||||
//graph placeholder
|
||||
Rectangle {
|
||||
width: 649
|
||||
height: 253
|
||||
anchors.centerIn: parent
|
||||
color: "pink"
|
||||
opacity: 0.3
|
||||
}
|
||||
}
|
|
@ -1,99 +0,0 @@
|
|||
import QtQuick 2.13
|
||||
import QtQuick.Controls 2.13
|
||||
import QtGraphicalEffects 1.13
|
||||
|
||||
import StatusQ.Components 0.1
|
||||
import StatusQ.Core.Theme 0.1
|
||||
|
||||
Item {
|
||||
id: root
|
||||
width: parent.width
|
||||
height: contentLoader.height
|
||||
|
||||
property string slug: ""
|
||||
property bool assetsLoaded: false
|
||||
property string collectionImageUrl: ""
|
||||
property int collectionIndex: -1
|
||||
property var store
|
||||
signal collectibleClicked()
|
||||
|
||||
// Not Refactored Yet
|
||||
// Connections {
|
||||
// target: root.store.walletV2ModelInst.collectiblesView.getAssetsList(root.slug)
|
||||
// onAssetsChanged: {
|
||||
// root.assetsLoaded = true;
|
||||
// }
|
||||
// }
|
||||
|
||||
Loader {
|
||||
id: contentLoader
|
||||
width: parent.width
|
||||
anchors.top: parent.top
|
||||
anchors.horizontalCenter: parent.horizontalCenter
|
||||
sourceComponent: root.assetsLoaded ? loaded : loading
|
||||
}
|
||||
|
||||
Component {
|
||||
id: loading
|
||||
|
||||
Item {
|
||||
id: loadingIndicator
|
||||
height: 164
|
||||
StatusLoadingIndicator {
|
||||
width: 20
|
||||
height: 20
|
||||
anchors.verticalCenter: parent.verticalCenter
|
||||
anchors.horizontalCenter: parent.horizontalCenter
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Component {
|
||||
id: loaded
|
||||
|
||||
Flow {
|
||||
width: parent.width
|
||||
|
||||
bottomPadding: 16
|
||||
spacing: 24
|
||||
|
||||
Repeater {
|
||||
// Not Refactored Yet
|
||||
// model: root.store.walletV2ModelInst.collectiblesView.getAssetsList(root.slug)
|
||||
StatusRoundedImage {
|
||||
id: image
|
||||
width: 146
|
||||
height: 146
|
||||
radius: 16
|
||||
image.source: model.imageUrl
|
||||
border.color: Theme.palette.baseColor2
|
||||
border.width: 1
|
||||
showLoadingIndicator: true
|
||||
color: model.backgroundColor
|
||||
MouseArea {
|
||||
anchors.fill: parent
|
||||
onClicked: {
|
||||
root.store.collectiblesStore.collectibleImageUrl = collectionImageUrl;
|
||||
root.store.collectiblesStore.name = model.name;
|
||||
root.store.collectiblesStore.collectibleId = model.id;
|
||||
root.store.collectiblesStore.description = model.description;
|
||||
root.store.collectiblesStore.permalink = model.permalink;
|
||||
root.store.collectiblesStore.imageUrl = model.imageUrl;
|
||||
root.store.collectiblesStore.backgroundColor = model.backgroundColor;
|
||||
root.store.collectiblesStore.properties = model.properties;
|
||||
root.store.collectiblesStore.rankings = model.rankings;
|
||||
root.store.collectiblesStore.stats = model.stats;
|
||||
root.store.collectiblesStore.collectionIndex = root.collectionIndex;
|
||||
root.collectibleClicked();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Component.onCompleted: {
|
||||
// Not Refactored Yet
|
||||
// root.store.walletV2ModelInst.collectiblesView.loadAssets(root.store.walletV2ModelInst.accountsView.currentAccount.address, root.slug);
|
||||
}
|
||||
}
|
|
@ -1,235 +0,0 @@
|
|||
import QtQuick 2.13
|
||||
import QtQuick.Controls 2.13
|
||||
import QtQuick.Layouts 1.13
|
||||
|
||||
import StatusQ.Components 0.1
|
||||
import StatusQ.Core.Theme 0.1
|
||||
import StatusQ.Core 0.1
|
||||
import StatusQ.Controls 0.1
|
||||
|
||||
import "../"
|
||||
import "../../controls"
|
||||
|
||||
StackDetailBase {
|
||||
id: root
|
||||
backButtonText: "Collectibles"
|
||||
|
||||
property var store
|
||||
property var assetStats: root.store.collectiblesStore.stats
|
||||
property var assetRankings: root.store.collectiblesStore.rankings
|
||||
property var assetProperties: root.store.collectiblesStore.properties
|
||||
property int collectionIndex: root.store.collectiblesStore.collectionIndex
|
||||
|
||||
CollectibleDetailsHeader {
|
||||
id: collectibleHeader
|
||||
anchors.left: parent.left
|
||||
anchors.right: parent.right
|
||||
image.source: root.store.collectiblesStore.collectibleImageUrl
|
||||
primaryText: root.store.collectiblesStore.name
|
||||
secondaryText: root.store.collectiblesStore.collectibleId
|
||||
}
|
||||
|
||||
Item {
|
||||
anchors.bottom: parent.bottom
|
||||
anchors.left: parent.left
|
||||
anchors.right: parent.right
|
||||
anchors.top: collectibleHeader.bottom
|
||||
anchors.topMargin: 46
|
||||
|
||||
Row {
|
||||
id: collectibleImageDetails
|
||||
anchors.top: parent.top
|
||||
width: parent.width
|
||||
spacing: 24
|
||||
|
||||
StatusRoundedImage {
|
||||
id: collectibleimage
|
||||
width: 253
|
||||
height: 253
|
||||
radius: 2
|
||||
color: root.store.collectiblesStore.backgroundColor
|
||||
border.color: Theme.palette.directColor8
|
||||
border.width: 1
|
||||
image.source: root.store.collectiblesStore.imageUrl
|
||||
}
|
||||
StatusBaseText {
|
||||
id: collectibleText
|
||||
width: parent.width - collectibleimage.width - 24
|
||||
height: collectibleimage.height
|
||||
|
||||
text: root.store.collectiblesStore.description
|
||||
color: Theme.palette.directColor1
|
||||
font.pixelSize: 15
|
||||
lineHeight: 22
|
||||
lineHeightMode: Text.FixedHeight
|
||||
elide: Text.ElideRight
|
||||
wrapMode: Text.Wrap
|
||||
}
|
||||
}
|
||||
|
||||
ListView {
|
||||
anchors.top: collectibleImageDetails.bottom
|
||||
anchors.topMargin: 32
|
||||
anchors.bottom: parent.bottom
|
||||
anchors.bottomMargin: 20
|
||||
anchors.horizontalCenter: parent.horizontalCenter
|
||||
width: parent.width
|
||||
|
||||
clip: true
|
||||
boundsBehavior: Flickable.StopAtBounds
|
||||
model: 3
|
||||
delegate: StatusExpandableItem {
|
||||
width: parent.width
|
||||
height: childrenRect.height
|
||||
anchors.horizontalCenter: parent.horizontalCenter
|
||||
|
||||
primaryText: index === 0 ? qsTr("Properties") : index === 1 ? qsTr("Levels") : qsTr("Stats")
|
||||
type: StatusExpandableItem.Type.Tertiary
|
||||
expandableComponent: index === 0 ? properties : index === 1 ? rankings : stats
|
||||
visible: index === 0 ? (!!assetProperties ? assetProperties.rowCount() !== 0 : false) :
|
||||
index === 1 ? (!!assetRankings ? assetRankings.rowCount() !== 0 : false) :
|
||||
(!!assetStats ? assetStats.rowCount() !== 0 : false)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Component {
|
||||
id: properties
|
||||
|
||||
Flow {
|
||||
width: parent.width
|
||||
spacing: 10
|
||||
|
||||
Repeater {
|
||||
model: assetProperties
|
||||
Rectangle {
|
||||
id: containerRect
|
||||
height: 52
|
||||
width: 147
|
||||
color: "transparent"
|
||||
border.color: Theme.palette.baseColor2
|
||||
border.width: 1
|
||||
radius: 8
|
||||
Column {
|
||||
anchors.horizontalCenter: parent.horizontalCenter
|
||||
anchors.top: parent.top
|
||||
anchors.topMargin: 6
|
||||
StatusBaseText {
|
||||
width: containerRect.width - 12
|
||||
|
||||
color: Theme.palette.baseColor1
|
||||
font.pixelSize: 13
|
||||
lineHeight: 18
|
||||
lineHeightMode: Text.FixedHeight
|
||||
elide: Text.ElideRight
|
||||
horizontalAlignment: Text.AlignHCenter
|
||||
text: model.traitType
|
||||
font.capitalization: Font.Capitalize
|
||||
}
|
||||
StatusBaseText {
|
||||
width: containerRect.width - 12
|
||||
|
||||
color: Theme.palette.directColor1
|
||||
font.pixelSize: 15
|
||||
lineHeight: 22
|
||||
lineHeightMode: Text.FixedHeight
|
||||
horizontalAlignment: Text.AlignHCenter
|
||||
elide: Text.ElideRight
|
||||
text: model.value
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// To-do change to progress bar one design is finalized
|
||||
Component {
|
||||
id: rankings
|
||||
|
||||
Column {
|
||||
width: parent.width
|
||||
spacing: 10
|
||||
|
||||
Repeater {
|
||||
model: assetRankings
|
||||
Rectangle {
|
||||
anchors.horizontalCenter: parent.horizontalCenter
|
||||
width: parent.width
|
||||
height: 52
|
||||
color: Theme.palette.baseColor4
|
||||
StatusBaseText {
|
||||
anchors.left: parent.left
|
||||
anchors.leftMargin: 10
|
||||
anchors.verticalCenter: parent.verticalCenter
|
||||
color: Theme.palette.baseColor1
|
||||
font.pixelSize: 15
|
||||
lineHeight: 22
|
||||
lineHeightMode: Text.FixedHeight
|
||||
elide: Text.ElideRight
|
||||
horizontalAlignment: Text.AlignLeft
|
||||
text: model.traitType
|
||||
font.capitalization: Font.Capitalize
|
||||
}
|
||||
StatusBaseText {
|
||||
anchors.right: parent.right
|
||||
anchors.rightMargin: 10
|
||||
anchors.verticalCenter: parent.verticalCenter
|
||||
color: Theme.palette.directColor1
|
||||
font.pixelSize: 15
|
||||
lineHeight: 22
|
||||
lineHeightMode: Text.FixedHeight
|
||||
horizontalAlignment: Text.AlignLeft
|
||||
elide: Text.ElideRight
|
||||
text: root.store.getCollectionMaxValue(model.traitType, model.value, model.maxValue, collectionIndex)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// To-do change to progress bar one design is finalized
|
||||
Component {
|
||||
id: stats
|
||||
|
||||
Column {
|
||||
width: parent.width
|
||||
spacing: 10
|
||||
|
||||
Repeater {
|
||||
model: assetStats
|
||||
Rectangle {
|
||||
anchors.horizontalCenter: parent.horizontalCenter
|
||||
width: parent.width
|
||||
height: 52
|
||||
color: Theme.palette.baseColor4
|
||||
StatusBaseText {
|
||||
anchors.left: parent.left
|
||||
anchors.leftMargin: 10
|
||||
anchors.verticalCenter: parent.verticalCenter
|
||||
color: Theme.palette.baseColor1
|
||||
font.pixelSize: 15
|
||||
lineHeight: 22
|
||||
lineHeightMode: Text.FixedHeight
|
||||
elide: Text.ElideRight
|
||||
horizontalAlignment: Text.AlignLeft
|
||||
text: model.traitType
|
||||
font.capitalization: Font.Capitalize
|
||||
}
|
||||
StatusBaseText {
|
||||
anchors.right: parent.right
|
||||
anchors.rightMargin: 10
|
||||
anchors.verticalCenter: parent.verticalCenter
|
||||
color: Theme.palette.directColor1
|
||||
font.pixelSize: 15
|
||||
lineHeight: 22
|
||||
lineHeightMode: Text.FixedHeight
|
||||
horizontalAlignment: Text.AlignLeft
|
||||
elide: Text.ElideRight
|
||||
text: root.store.getCollectionMaxValue(model.traitType, model.value, model.maxValue, collectionIndex)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
|
@ -11,7 +11,6 @@ import shared.popups 1.0
|
|||
import shared.status 1.0
|
||||
import "./AppLayouts"
|
||||
import "./AppLayouts/Wallet"
|
||||
import "./AppLayouts/WalletV2"
|
||||
import "./AppLayouts/Chat/popups"
|
||||
import "./AppLayouts/Chat/popups/community"
|
||||
import "./AppLayouts/Profile/popups"
|
||||
|
@ -421,9 +420,6 @@ Item {
|
|||
else if(mainModule.activeSection.sectionType === Constants.appSection.wallet) {
|
||||
return Constants.appViewStackIndex.wallet
|
||||
}
|
||||
else if(mainModule.activeSection.sectionType === Constants.appSection.walletv2) {
|
||||
return Constants.appViewStackIndex.walletv2
|
||||
}
|
||||
else if(mainModule.activeSection.sectionType === Constants.appSection.browser) {
|
||||
return Constants.appViewStackIndex.browser
|
||||
}
|
||||
|
@ -454,10 +450,6 @@ Item {
|
|||
if(obj === walletLayoutContainer){
|
||||
walletLayoutContainer.showSigningPhrasePopup();
|
||||
}
|
||||
|
||||
if(obj === walletV2LayoutContainer){
|
||||
walletV2LayoutContainer.showSigningPhrasePopup();
|
||||
}
|
||||
}
|
||||
|
||||
// NOTE:
|
||||
|
@ -541,13 +533,6 @@ Item {
|
|||
Layout.fillHeight: true
|
||||
}
|
||||
|
||||
WalletV2Layout {
|
||||
id: walletV2LayoutContainer
|
||||
Layout.fillWidth: true
|
||||
Layout.alignment: Qt.AlignLeft | Qt.AlignTop
|
||||
Layout.fillHeight: true
|
||||
}
|
||||
|
||||
Repeater {
|
||||
model: mainModule.sectionsModel
|
||||
|
||||
|
|
|
@ -13,17 +13,15 @@ QtObject {
|
|||
readonly property int chat: 0
|
||||
readonly property int community: 1
|
||||
readonly property int wallet: 2
|
||||
readonly property int walletv2: 3
|
||||
readonly property int browser: 4
|
||||
readonly property int profile: 5
|
||||
readonly property int node: 6
|
||||
readonly property int browser: 3
|
||||
readonly property int profile: 4
|
||||
readonly property int node: 5
|
||||
}
|
||||
|
||||
readonly property QtObject appViewStackIndex: QtObject {
|
||||
readonly property int chat: 0
|
||||
readonly property int community: 7 // any stack layout children with the index 7 or higher is community
|
||||
readonly property int wallet: 1
|
||||
readonly property int walletv2: 5
|
||||
readonly property int browser: 2
|
||||
readonly property int profile: 3
|
||||
readonly property int node: 4
|
||||
|
|
Loading…
Reference in New Issue