2022-10-25 08:24:47 +00:00
|
|
|
import QtQuick 2.14
|
2022-11-07 13:14:18 +00:00
|
|
|
import QtQuick.Controls 2.14
|
2022-10-25 08:24:47 +00:00
|
|
|
|
2023-06-23 06:17:04 +00:00
|
|
|
import AppLayouts.Communities.popups 1.0
|
2022-10-25 08:24:47 +00:00
|
|
|
import utils 1.0
|
|
|
|
|
2022-11-07 13:14:18 +00:00
|
|
|
import Storybook 1.0
|
|
|
|
|
|
|
|
SplitView {
|
|
|
|
orientation: Qt.Vertical
|
|
|
|
|
|
|
|
Logs { id: logs }
|
2022-10-25 08:24:47 +00:00
|
|
|
|
|
|
|
property bool globalUtilsReady: false
|
|
|
|
property bool mainModuleReady: false
|
2023-12-11 09:47:30 +00:00
|
|
|
property bool communitiesModuleReady: false
|
2022-10-25 08:24:47 +00:00
|
|
|
|
2022-11-07 13:14:18 +00:00
|
|
|
Item {
|
|
|
|
|
|
|
|
SplitView.fillWidth: true
|
|
|
|
SplitView.fillHeight: true
|
2022-10-25 08:24:47 +00:00
|
|
|
|
2022-11-08 21:23:55 +00:00
|
|
|
PopupBackground {
|
2022-11-07 13:14:18 +00:00
|
|
|
anchors.fill: parent
|
2022-10-25 08:24:47 +00:00
|
|
|
}
|
|
|
|
|
2022-11-07 13:14:18 +00:00
|
|
|
Button {
|
|
|
|
anchors.centerIn: parent
|
|
|
|
text: "Reopen"
|
2022-10-25 08:24:47 +00:00
|
|
|
|
2022-11-07 13:14:18 +00:00
|
|
|
onClicked: loader.item.open()
|
2022-10-25 08:24:47 +00:00
|
|
|
}
|
|
|
|
|
2022-11-07 13:14:18 +00:00
|
|
|
QtObject {
|
|
|
|
function getCompressedPk(publicKey) {
|
|
|
|
return "compressed"
|
|
|
|
}
|
|
|
|
|
|
|
|
function isCompressedPubKey() {
|
|
|
|
return true
|
|
|
|
}
|
|
|
|
|
|
|
|
function getColorHashAsJson(publicKey) {
|
|
|
|
return JSON.stringify([{colorId: 0, segmentLength: 1},
|
|
|
|
{colorId: 19, segmentLength: 2}])
|
|
|
|
}
|
2022-10-25 08:24:47 +00:00
|
|
|
|
2023-12-11 09:47:30 +00:00
|
|
|
function copyToClipboard(text) {
|
|
|
|
}
|
|
|
|
|
2022-11-07 13:14:18 +00:00
|
|
|
Component.onCompleted: {
|
|
|
|
Utils.globalUtilsInst = this
|
|
|
|
globalUtilsReady = true
|
|
|
|
|
|
|
|
}
|
|
|
|
Component.onDestruction: {
|
|
|
|
globalUtilsReady = false
|
|
|
|
Utils.globalUtilsInst = {}
|
|
|
|
}
|
2022-10-25 08:24:47 +00:00
|
|
|
}
|
2022-11-07 13:14:18 +00:00
|
|
|
|
|
|
|
QtObject {
|
|
|
|
function getContactDetailsAsJson() {
|
|
|
|
return JSON.stringify({})
|
|
|
|
}
|
|
|
|
|
|
|
|
Component.onCompleted: {
|
|
|
|
mainModuleReady = true
|
|
|
|
Utils.mainModuleInst = this
|
|
|
|
}
|
|
|
|
Component.onDestruction: {
|
|
|
|
mainModuleReady = false
|
|
|
|
Utils.mainModuleInst = {}
|
|
|
|
}
|
2022-10-25 08:24:47 +00:00
|
|
|
}
|
|
|
|
|
2023-12-11 09:47:30 +00:00
|
|
|
QtObject {
|
|
|
|
function shareCommunityUrlWithData(communityId) {
|
|
|
|
return "status-app:/"+communityId
|
|
|
|
}
|
|
|
|
|
|
|
|
Component.onCompleted: {
|
|
|
|
communitiesModuleReady = true
|
|
|
|
Utils.communitiesModuleInst = this
|
|
|
|
}
|
|
|
|
Component.onDestruction: {
|
|
|
|
communitiesModuleReady = false
|
|
|
|
Utils.communitiesModuleInst = {}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2022-11-07 13:14:18 +00:00
|
|
|
Loader {
|
|
|
|
id: loader
|
2023-12-11 09:47:30 +00:00
|
|
|
active: globalUtilsReady && mainModuleReady && communitiesModuleReady
|
2022-11-07 13:14:18 +00:00
|
|
|
anchors.fill: parent
|
2022-10-25 08:24:47 +00:00
|
|
|
|
2022-11-07 13:14:18 +00:00
|
|
|
sourceComponent: InviteFriendsToCommunityPopup {
|
|
|
|
parent: parent
|
|
|
|
modal: false
|
|
|
|
anchors.centerIn: parent
|
2022-10-25 08:24:47 +00:00
|
|
|
|
2023-05-11 10:57:00 +00:00
|
|
|
closePolicy: Popup.NoAutoClose
|
|
|
|
|
2022-11-07 13:14:18 +00:00
|
|
|
community: ({
|
|
|
|
id: "communityId",
|
|
|
|
name: "community-name"
|
|
|
|
})
|
2022-10-25 08:24:47 +00:00
|
|
|
|
2022-11-07 13:14:18 +00:00
|
|
|
rootStore: QtObject {
|
|
|
|
function communityHasMember(communityId, pubKey) {
|
|
|
|
return false
|
|
|
|
}
|
2022-10-25 08:24:47 +00:00
|
|
|
}
|
|
|
|
|
2022-11-07 13:14:18 +00:00
|
|
|
communitySectionModule: QtObject {
|
2023-07-26 09:42:30 +00:00
|
|
|
function shareCommunityToUsers(keys, message) {
|
|
|
|
logs.logEvent("communitySectionModule::shareCommunityToUsers",
|
2022-11-07 13:14:18 +00:00
|
|
|
["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
|
|
|
|
})
|
|
|
|
}
|
2022-10-25 08:24:47 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2022-11-07 13:14:18 +00:00
|
|
|
Component.onCompleted: open()
|
|
|
|
}
|
2022-10-25 08:24:47 +00:00
|
|
|
}
|
|
|
|
}
|
2022-11-07 13:14:18 +00:00
|
|
|
|
|
|
|
LogsAndControlsPanel {
|
|
|
|
id: logsAndControlsPanel
|
|
|
|
|
|
|
|
SplitView.minimumHeight: 100
|
|
|
|
SplitView.preferredHeight: 200
|
|
|
|
|
|
|
|
logsView.logText: logs.logText
|
|
|
|
}
|
2022-10-25 08:24:47 +00:00
|
|
|
}
|
2023-07-31 12:21:14 +00:00
|
|
|
|
|
|
|
// category: Popups
|
2023-10-03 11:56:30 +00:00
|
|
|
|
|
|
|
// https://www.figma.com/file/17fc13UBFvInrLgNUKJJg5/Kuba%E2%8E%9CDesktop?node-id=2927%3A343592
|
|
|
|
// https://www.figma.com/file/17fc13UBFvInrLgNUKJJg5/Kuba%E2%8E%9CDesktop?node-id=2990%3A353179
|
|
|
|
// https://www.figma.com/file/17fc13UBFvInrLgNUKJJg5/Kuba%E2%8E%9CDesktop?node-id=2927%3A344073
|
|
|
|
// https://www.figma.com/file/17fc13UBFvInrLgNUKJJg5/Kuba%E2%8E%9CDesktop?node-id=4291%3A385536
|
|
|
|
// https://www.figma.com/file/17fc13UBFvInrLgNUKJJg5/Kuba%E2%8E%9CDesktop?node-id=4295%3A385958
|