fix(Storybook): update InviteFriendsToCommunityPopup page

This commit is contained in:
Michał Cieślak 2022-11-07 14:14:18 +01:00 committed by Michał
parent 6e705eab2a
commit c21337a02f
3 changed files with 121 additions and 72 deletions

View File

@ -18,6 +18,10 @@ Item {
{colorId: 19, segmentLength: 2}]) {colorId: 19, segmentLength: 2}])
} }
function isCompressedPubKey() {
return true
}
Component.onCompleted: { Component.onCompleted: {
Utils.globalUtilsInst = this Utils.globalUtilsInst = this
globalUtilsReady = true globalUtilsReady = true

View File

@ -13,6 +13,10 @@ Item {
return "compressed" return "compressed"
} }
function isCompressedPubKey() {
return true
}
function getColorHashAsJson(publicKey) { function getColorHashAsJson(publicKey) {
return JSON.stringify([{colorId: 0, segmentLength: 1}, return JSON.stringify([{colorId: 0, segmentLength: 1},
{colorId: 19, segmentLength: 2}]) {colorId: 19, segmentLength: 2}])

View File

@ -1,22 +1,45 @@
import QtQuick 2.14 import QtQuick 2.14
import QtQuick.Controls 2.14
import AppLayouts.Chat.popups 1.0 import AppLayouts.Chat.popups 1.0
import utils 1.0 import utils 1.0
import Storybook 1.0
SplitView {
orientation: Qt.Vertical
Logs { id: logs }
property bool globalUtilsReady: false
property bool mainModuleReady: false
Item { Item {
SplitView.fillWidth: true
SplitView.fillHeight: true
Rectangle { Rectangle {
color: 'lightgray' color: 'lightgray'
anchors.fill: parent anchors.fill: parent
} }
property bool globalUtilsReady: false Button {
property bool mainModuleReady: false anchors.centerIn: parent
text: "Reopen"
onClicked: loader.item.open()
}
QtObject { QtObject {
function getCompressedPk(publicKey) { function getCompressedPk(publicKey) {
return "compressed" return "compressed"
} }
function isCompressedPubKey() {
return true
}
function getColorHashAsJson(publicKey) { function getColorHashAsJson(publicKey) {
return JSON.stringify([{colorId: 0, segmentLength: 1}, return JSON.stringify([{colorId: 0, segmentLength: 1},
{colorId: 19, segmentLength: 2}]) {colorId: 19, segmentLength: 2}])
@ -49,6 +72,7 @@ Item {
} }
Loader { Loader {
id: loader
active: globalUtilsReady && mainModuleReady active: globalUtilsReady && mainModuleReady
anchors.fill: parent anchors.fill: parent
@ -68,6 +92,13 @@ Item {
} }
} }
communitySectionModule: QtObject {
function inviteUsersToCommunity() {
logs.logEvent("communitySectionModule::inviteUsersToCommunity",
["keys", "message"], arguments)
}
}
contactsStore: QtObject { contactsStore: QtObject {
readonly property ListModel myContactsModel: ListModel { readonly property ListModel myContactsModel: ListModel {
Component.onCompleted: { Component.onCompleted: {
@ -94,3 +125,13 @@ Item {
} }
} }
} }
LogsAndControlsPanel {
id: logsAndControlsPanel
SplitView.minimumHeight: 100
SplitView.preferredHeight: 200
logsView.logText: logs.logText
}
}