diff --git a/storybook/pages/CommunityProfilePopupInviteFriendsPanelPage.qml b/storybook/pages/CommunityProfilePopupInviteFriendsPanelPage.qml index 7a14380118..6f73e09bd4 100644 --- a/storybook/pages/CommunityProfilePopupInviteFriendsPanelPage.qml +++ b/storybook/pages/CommunityProfilePopupInviteFriendsPanelPage.qml @@ -18,6 +18,10 @@ Item { {colorId: 19, segmentLength: 2}]) } + function isCompressedPubKey() { + return true + } + Component.onCompleted: { Utils.globalUtilsInst = this globalUtilsReady = true diff --git a/storybook/pages/CommunityProfilePopupInviteMessagePanelPage.qml b/storybook/pages/CommunityProfilePopupInviteMessagePanelPage.qml index b782387c90..f88461ae1e 100644 --- a/storybook/pages/CommunityProfilePopupInviteMessagePanelPage.qml +++ b/storybook/pages/CommunityProfilePopupInviteMessagePanelPage.qml @@ -13,6 +13,10 @@ Item { return "compressed" } + function isCompressedPubKey() { + return true + } + function getColorHashAsJson(publicKey) { return JSON.stringify([{colorId: 0, segmentLength: 1}, {colorId: 19, segmentLength: 2}]) diff --git a/storybook/pages/InviteFriendsToCommunityPopupPage.qml b/storybook/pages/InviteFriendsToCommunityPopupPage.qml index 757afbde47..c6f0b5e642 100644 --- a/storybook/pages/InviteFriendsToCommunityPopupPage.qml +++ b/storybook/pages/InviteFriendsToCommunityPopupPage.qml @@ -1,96 +1,137 @@ import QtQuick 2.14 +import QtQuick.Controls 2.14 import AppLayouts.Chat.popups 1.0 import utils 1.0 -Item { - Rectangle { - color: 'lightgray' - anchors.fill: parent - } +import Storybook 1.0 + +SplitView { + orientation: Qt.Vertical + + Logs { id: logs } property bool globalUtilsReady: false property bool mainModuleReady: false - QtObject { - function getCompressedPk(publicKey) { - return "compressed" + Item { + + SplitView.fillWidth: true + SplitView.fillHeight: true + + Rectangle { + color: 'lightgray' + anchors.fill: parent } - function getColorHashAsJson(publicKey) { - return JSON.stringify([{colorId: 0, segmentLength: 1}, - {colorId: 19, segmentLength: 2}]) - } - - Component.onCompleted: { - Utils.globalUtilsInst = this - globalUtilsReady = true - - } - Component.onDestruction: { - globalUtilsReady = false - Utils.globalUtilsInst = {} - } - } - - QtObject { - function getContactDetailsAsJson() { - return JSON.stringify({}) - } - - Component.onCompleted: { - mainModuleReady = true - Utils.mainModuleInst = this - } - Component.onDestruction: { - mainModuleReady = false - Utils.mainModuleInst = {} - } - } - - Loader { - active: globalUtilsReady && mainModuleReady - anchors.fill: parent - - sourceComponent: InviteFriendsToCommunityPopup { - parent: parent - modal: false + Button { anchors.centerIn: parent + text: "Reopen" - community: ({ - id: "communityId", - name: "community-name" - }) + onClicked: loader.item.open() + } - rootStore: QtObject { - function communityHasMember(communityId, pubKey) { - return false - } + QtObject { + function getCompressedPk(publicKey) { + return "compressed" } - contactsStore: QtObject { - readonly property ListModel myContactsModel: ListModel { - Component.onCompleted: { - for (let i = 0; i < 20; i++) { - const key = `pub_key_${i}` + function isCompressedPubKey() { + return true + } - append({ - alias: "", - colorId: "1", - displayName: `contact ${i}`, - ensName: "", - icon: "", - isContact: true, - localNickname: "", - onlineStatus: 1, - pubKey: key - }) + function getColorHashAsJson(publicKey) { + return JSON.stringify([{colorId: 0, segmentLength: 1}, + {colorId: 19, segmentLength: 2}]) + } + + Component.onCompleted: { + Utils.globalUtilsInst = this + globalUtilsReady = true + + } + Component.onDestruction: { + globalUtilsReady = false + Utils.globalUtilsInst = {} + } + } + + QtObject { + function getContactDetailsAsJson() { + return JSON.stringify({}) + } + + Component.onCompleted: { + mainModuleReady = true + Utils.mainModuleInst = this + } + Component.onDestruction: { + mainModuleReady = false + Utils.mainModuleInst = {} + } + } + + Loader { + id: loader + active: globalUtilsReady && mainModuleReady + anchors.fill: parent + + sourceComponent: InviteFriendsToCommunityPopup { + parent: parent + modal: false + anchors.centerIn: parent + + community: ({ + id: "communityId", + name: "community-name" + }) + + rootStore: QtObject { + function communityHasMember(communityId, pubKey) { + return false + } + } + + communitySectionModule: QtObject { + function inviteUsersToCommunity() { + logs.logEvent("communitySectionModule::inviteUsersToCommunity", + ["keys", "message"], arguments) + } + } + + contactsStore: QtObject { + readonly property ListModel myContactsModel: ListModel { + Component.onCompleted: { + for (let i = 0; i < 20; i++) { + const key = `pub_key_${i}` + + append({ + alias: "", + colorId: "1", + displayName: `contact ${i}`, + ensName: "", + icon: "", + isContact: true, + localNickname: "", + onlineStatus: 1, + pubKey: key + }) + } } } } - } - Component.onCompleted: open() + Component.onCompleted: open() + } } } + + LogsAndControlsPanel { + id: logsAndControlsPanel + + SplitView.minimumHeight: 100 + SplitView.preferredHeight: 200 + + logsView.logText: logs.logText + } }