2023-08-07 09:21:46 +00:00
|
|
|
import QtQuick 2.15
|
|
|
|
import QtQuick.Controls 2.15
|
|
|
|
import QtQuick.Layouts 1.15
|
|
|
|
|
|
|
|
import Qt.labs.settings 1.0
|
|
|
|
|
2024-10-15 19:26:12 +00:00
|
|
|
import StatusQ.Core.Theme 0.1
|
|
|
|
|
2023-08-07 09:21:46 +00:00
|
|
|
import mainui.activitycenter.views 1.0
|
|
|
|
import mainui.activitycenter.stores 1.0
|
|
|
|
|
2024-10-24 08:41:28 +00:00
|
|
|
import AppLayouts.Chat.stores 1.0 as ChatStores
|
|
|
|
|
2023-08-07 09:21:46 +00:00
|
|
|
import utils 1.0
|
|
|
|
|
|
|
|
import Storybook 1.0
|
|
|
|
|
|
|
|
SplitView {
|
|
|
|
id: root
|
|
|
|
|
|
|
|
property bool utilsReady: false
|
|
|
|
|
|
|
|
orientation: Qt.Vertical
|
|
|
|
|
|
|
|
Logs { id: logs }
|
|
|
|
|
|
|
|
Item {
|
|
|
|
id: wrapper
|
|
|
|
SplitView.fillHeight: true
|
|
|
|
SplitView.fillWidth: true
|
|
|
|
|
|
|
|
Loader {
|
|
|
|
active: root.utilsReady
|
|
|
|
anchors.centerIn: parent
|
|
|
|
width: parent.width - 50
|
|
|
|
height: 80
|
|
|
|
|
|
|
|
sourceComponent : ActivityNotificationCommunityMembershipRequest {
|
|
|
|
store: storeMock
|
|
|
|
notification: notificationMock
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
LogsAndControlsPanel {
|
|
|
|
SplitView.minimumHeight: 100
|
|
|
|
SplitView.preferredHeight: 160
|
|
|
|
|
|
|
|
logsView.logText: logs.logText
|
|
|
|
|
|
|
|
ColumnLayout {
|
|
|
|
anchors.top: parent.top
|
|
|
|
anchors.left: parent.left
|
|
|
|
anchors.right: parent.right
|
|
|
|
Label {
|
|
|
|
text: "Request state"
|
|
|
|
}
|
|
|
|
|
|
|
|
ComboBox {
|
|
|
|
id: stateSelector
|
|
|
|
textRole: "text"
|
|
|
|
valueRole: "value"
|
|
|
|
model: ListModel {
|
|
|
|
id: model
|
2023-10-23 11:35:20 +00:00
|
|
|
|
|
|
|
ListElement { text: "Pending"; value: 1 } // ActivityCenterStore.ActivityCenterMembershipStatus.Pending }
|
|
|
|
ListElement { text: "Accepted"; value: 2 } //ActivityCenterStore.ActivityCenterMembershipStatus.Accepted }
|
|
|
|
ListElement { text: "Declined"; value: 3 } //ActivityCenterStore.ActivityCenterMembershipStatus.Declined }
|
|
|
|
ListElement { text: "AcceptedPending"; value: 4 } //ActivityCenterStore.ActivityCenterMembershipStatus.AcceptedPending }
|
|
|
|
ListElement { text: "DeclinedPending"; value: 5 } //ActivityCenterStore.ActivityCenterMembershipStatus.DeclinedPending }
|
2023-08-07 09:21:46 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
QtObject {
|
|
|
|
id: utilsMock
|
|
|
|
function getContactDetailsAsJson(arg1, arg2) {
|
|
|
|
return JSON.stringify({
|
|
|
|
displayName: "Mock user",
|
2024-10-15 19:26:12 +00:00
|
|
|
displayIcon: Theme.png("tokens/AST"),
|
2023-08-07 09:21:46 +00:00
|
|
|
publicKey: 123456789,
|
|
|
|
name: "",
|
|
|
|
ensVerified: false,
|
|
|
|
alias: "",
|
|
|
|
lastUpdated: 0,
|
|
|
|
lastUpdatedLocally: 0,
|
|
|
|
localNickname: "",
|
|
|
|
thumbnailImage: "",
|
|
|
|
largeImage: "",
|
|
|
|
isContact: false,
|
|
|
|
isAdded: false,
|
|
|
|
isBlocked: false,
|
|
|
|
requestReceived: false,
|
|
|
|
isSyncing: false,
|
|
|
|
removed: false,
|
|
|
|
trustStatus: Constants.trustStatus.unknown,
|
|
|
|
verificationStatus: Constants.verificationStatus.unverified,
|
|
|
|
})
|
|
|
|
}
|
|
|
|
|
|
|
|
function isCompressedPubKey(key) {
|
|
|
|
return true
|
|
|
|
}
|
|
|
|
|
|
|
|
function getColorId(publicKey) {
|
|
|
|
return 1
|
|
|
|
}
|
|
|
|
|
|
|
|
function isEnsVerified(publicKey) {
|
|
|
|
return true
|
|
|
|
}
|
|
|
|
|
|
|
|
Component.onCompleted: {
|
|
|
|
Utils.mainModuleInst = this
|
|
|
|
Utils.globalUtilsInst = this
|
|
|
|
root.utilsReady = true
|
|
|
|
}
|
|
|
|
Component.onDestruction: {
|
|
|
|
root.utilsReady = false
|
|
|
|
Utils.mainModuleInst = {}
|
|
|
|
Utils.globalUtilsInst = {}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2024-10-24 08:41:28 +00:00
|
|
|
ChatStores.RootStore {
|
2023-08-07 09:21:46 +00:00
|
|
|
id: storeMock
|
|
|
|
|
|
|
|
function getCommunityDetailsAsJson(community) {
|
|
|
|
return {
|
|
|
|
name : "Mock Community",
|
2024-10-15 19:26:12 +00:00
|
|
|
image : Theme.png("tokens/UNI"),
|
2023-08-07 09:21:46 +00:00
|
|
|
color : "orchid"
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
function acceptRequestToJoinCommunity(notificationId, communityId) {
|
|
|
|
stateSelector.currentIndex = stateSelector.indexOfValue(ActivityCenterStore.ActivityCenterMembershipStatus.AcceptedPending)
|
|
|
|
}
|
|
|
|
|
|
|
|
function declineRequestToJoinCommunity(notificationId, communityId) {
|
|
|
|
stateSelector.currentIndex = stateSelector.indexOfValue(ActivityCenterStore.ActivityCenterMembershipStatus.DeclinedPending)
|
|
|
|
}
|
|
|
|
|
|
|
|
property var contactsStore: QtObject {
|
|
|
|
property var myContactsModel: QtObject {
|
|
|
|
signal itemChanged(string pubKey)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
QtObject {
|
|
|
|
id: notificationMock
|
|
|
|
property string id: "1"
|
|
|
|
property string chatId: "1"
|
|
|
|
property string communityId: "1"
|
|
|
|
property int membershipStatus: stateSelector.currentValue
|
|
|
|
property int verificationStatus: 1
|
|
|
|
property string sectionId: "1"
|
|
|
|
property string name: "name"
|
|
|
|
property string author: "author"
|
|
|
|
property int notificationType: 1
|
|
|
|
property var message: QtObject {
|
|
|
|
property bool amISender: false
|
|
|
|
}
|
|
|
|
|
|
|
|
property int timestamp: Date.now()
|
|
|
|
property int previousTimestamp: 0
|
|
|
|
property bool read: false
|
|
|
|
property bool dismissed: false
|
|
|
|
property bool accepted: false
|
|
|
|
property var repliedMessage: ({})
|
|
|
|
property int chatType: 1
|
|
|
|
}
|
|
|
|
|
|
|
|
Settings {
|
|
|
|
property alias activityNotificationRequestState: stateSelector.currentIndex
|
|
|
|
}
|
|
|
|
}
|
2023-10-03 11:56:30 +00:00
|
|
|
|
2023-10-23 11:35:20 +00:00
|
|
|
// category: Activity Center
|
2023-10-03 11:56:30 +00:00
|
|
|
// https://www.figma.com/file/17fc13UBFvInrLgNUKJJg5/Kuba⎜Desktop?type=design&node-id=35909-606817&mode=design&t=Ia7Z0AzyYIjkuPtr-0
|