2023-02-01 17:33:56 +00:00
import QtQuick 2.14
import QtQuick . Controls 2.14
import QtQuick . Layouts 1.14
import StatusQ . Core . Theme 0.1
import StatusQ . Components 0.1
2023-06-23 06:17:04 +00:00
import AppLayouts . Communities . views 1.0
2023-02-01 17:33:56 +00:00
import Storybook 1.0
import Models 1.0
import utils 1.0
SplitView {
QtObject {
id: d
// General properties:
property string name: "Uniswap"
property string communityDesc: "General channel for the community"
2023-02-02 15:27:37 +00:00
property string introMessage: " % 1 sed ut perspiciatis unde omnis iste natus error sit voluptatem accusantium doloremque laudantium , totam rem aperiam , eaque ipsa quae ab illo inventore veritatis et quasi architecto beatae vitae dicta sunt explicabo .
1 . Ut enim ad minim veniam
2 . Excepteur sint occaecat cupidatat non proident
3 . Duis aute irure
4 . Dolore eu fugiat nulla pariatur
5 . 🚗 consectetur adipiscing elit
Nemo enim 😋 ipsam voluptatem quia voluptas sit aspernatur aut odit aut fugit , sed quia consequuntur magni dolores eos qui ratione voluptatem sequi nesciunt . " . arg ( d . name )
2023-02-01 17:33:56 +00:00
property color color: "orchid"
property string channelName: joinCommunity ? "general" : "#vip"
property string channelDesc: "VIP members only"
property bool joinCommunity: true // Otherwise it means join channel action
2023-02-02 15:27:37 +00:00
property int accessType: Constants . communityChatPublicAccess
2023-02-01 17:33:56 +00:00
// Overlay component:
property bool requirementsMet: true
2024-04-04 16:03:10 +00:00
property int requestToJoinState: Constants . RequestToJoinState . None
property bool isInvitationPending: requestToJoinState !== Constants . RequestToJoinState . None
2023-02-01 17:33:56 +00:00
property bool isJoinRequestRejected: false
property bool requiresRequest: false
2023-02-13 10:40:13 +00:00
2023-02-14 16:33:23 +00:00
property var communityHoldingsModel: PermissionsModel . shortPermissionsModel
property var viewOnlyHoldingsModel: PermissionsModel . shortPermissionsModel
property var viewAndPostHoldingsModel: PermissionsModel . shortPermissionsModel
property var moderateHoldingsModel: PermissionsModel . shortPermissionsModel
2023-02-13 10:40:13 +00:00
property var assetsModel: AssetsModel { }
property var collectiblesModel: CollectiblesModel { }
2023-02-01 17:33:56 +00:00
// Blur background:
property int membersCount: 184
property bool amISectionAdmin: false
2024-10-15 19:26:12 +00:00
property url image: Theme . png ( "tokens/UNI" )
2023-02-01 17:33:56 +00:00
property var communityItemsModel: model1
property string chatDateTimeText: "Dec 31, 2020"
property string listUsersText: "simon, Mark Cuban "
readonly property ListModel model1: ListModel {
ListElement { name: "welcome" ; selected: false ; notificationsCount: 0 ; hasUnreadMessages: false }
ListElement { name: "general" ; selected: false ; notificationsCount: 0 ; hasUnreadMessages: true }
ListElement { name: "design" ; selected: true ; notificationsCount: 3 ; hasUnreadMessages: true }
ListElement { name: "random" ; selected: false ; notificationsCount: 0 ; hasUnreadMessages: false }
ListElement { name: "vip" ; selected: false ; notificationsCount: 0 ; hasUnreadMessages: true }
}
readonly property ListModel model2: ListModel {
ListElement { name: "general" ; selected: false ; notificationsCount: 3 ; hasUnreadMessages: false }
ListElement { name: "blockchain" ; selected: true ; notificationsCount: 3 ; hasUnreadMessages: true }
ListElement { name: "faq" ; selected: false ; notificationsCount: 0 ; hasUnreadMessages: false }
}
readonly property var messagesModel: ListModel {
ListElement {
timestamp: 1656937930
senderDisplayName: "simon"
contentType: StatusMessage . ContentType . Text
message: "Hello, this is awesome! Feels like decentralized Discord!"
isContact: true
trustIndicator: StatusContactVerificationIcons . TrustedType . Verified
colorId: 4
}
ListElement {
timestamp: 1657937930
senderDisplayName: "Mark Cuban"
contentType: StatusMessage . ContentType . Text
message: "I know a lot of you really seem to get off or be validated by arguing with strangers online but please know it's a complete waste of your time and energy"
isContact: false
trustIndicator: StatusContactVerificationIcons . TrustedType . Untrustworthy
colorId: 2
}
}
}
Logs { id: logs }
SplitView {
orientation: Qt . Vertical
SplitView.fillWidth: true
Rectangle {
SplitView.fillWidth: true
SplitView.fillHeight: true
color: Theme . palette . statusAppLayout . rightPanelBackgroundColor
clip: true
JoinCommunityView {
anchors.fill: parent
anchors.margins: 50
// General properties:
name: d . name
communityDesc: d . communityDesc
2023-02-02 15:27:37 +00:00
introMessage: d . introMessage
2023-02-01 17:33:56 +00:00
color: d . color
channelName: d . channelName
channelDesc: d . channelDesc
joinCommunity: d . joinCommunity
2023-02-02 15:27:37 +00:00
accessType: d . accessType
2024-04-04 16:03:10 +00:00
requestToJoinState: d . requestToJoinState
2023-02-01 17:33:56 +00:00
// Blur background properties:
membersCount: d . membersCount
image: d . image
amISectionAdmin: d . amISectionAdmin
openCreateChat: false
communityItemsModel: d . communityItemsModel
chatDateTimeText: d . chatDateTimeText
listUsersText: d . listUsersText
messagesModel: d . messagesModel
// Permissions properties
requirementsMet: d . requirementsMet
isJoinRequestRejected: d . isJoinRequestRejected
requiresRequest: d . requiresRequest
2023-02-13 10:40:13 +00:00
2023-02-14 16:33:23 +00:00
communityHoldingsModel: d . communityHoldingsModel
viewOnlyHoldingsModel: d . viewOnlyHoldingsModel
viewAndPostHoldingsModel: d . viewAndPostHoldingsModel
moderateHoldingsModel: d . moderateHoldingsModel
2023-02-13 10:40:13 +00:00
assetsModel: d . assetsModel
collectiblesModel: d . collectiblesModel
2023-02-01 17:33:56 +00:00
onInfoButtonClicked: logs . logEvent ( "JoinCommunityView::onInfoButtonClicked()" )
onAdHocChatButtonClicked: {
logs . logEvent ( "JoinCommunityView::store.openCloseCreateChatView(): " + openCreateChat . toString ( ) )
openCreateChat = ! openCreateChat
}
onNotificationButtonClicked: logs . logEvent ( "JoinCommunityView::onNotificationButtonClicked()" )
2024-03-27 07:37:28 +00:00
onRequestToJoinClicked: logs . logEvent ( "JoinCommunityView::onRequestToJoinClicked()" )
2023-02-01 17:33:56 +00:00
onInvitationPendingClicked: logs . logEvent ( "JoinCommunityView::onInvitationPendingClicked()" )
}
}
LogsAndControlsPanel {
id: logsAndControlsPanel
SplitView.minimumHeight: 100
SplitView.preferredHeight: 150
logsView.logText: logs . logText
}
}
Pane {
SplitView.minimumWidth: 300
SplitView.preferredWidth: 300
ScrollView {
anchors.fill: parent
ColumnLayout {
spacing: 16
// Blur info editor:
Label {
Layout.fillWidth: true
text: "BLUR INFO EDITOR"
font.bold: true
font.pixelSize: 18
}
CommunityInfoEditor {
name: d . name
membersCount: d . membersCount
amISectionAdmin: d . amISectionAdmin
color: d . color
image: d . image
colorVisible: true
onNameChanged: d . name = name
onMembersCountChanged: d . membersCount = membersCount
onAmISectionAdminChanged: d . amISectionAdmin = amISectionAdmin
onColorChanged: d . color = color
onImageChanged: d . image = image
}
ColumnLayout {
Label {
Layout.fillWidth: true
text: "Community items model:"
}
RadioButton {
checked: true
text: qsTr ( "Model 1" )
onCheckedChanged: if ( checked ) d . communityItemsModel = d . model1
}
RadioButton {
text: qsTr ( "Model 2" )
onCheckedChanged: if ( checked ) d . communityItemsModel = d . model2
}
}
2023-02-02 15:27:37 +00:00
// Join types:
Label {
Layout.fillWidth: true
text: "JOIN TYPES"
font.bold: true
font.pixelSize: 18
}
ColumnLayout {
Label {
Layout.fillWidth: true
text: "Is invitation pending:"
}
CheckBox {
checked: d . isInvitationPending
2024-04-04 16:03:10 +00:00
onCheckedChanged: {
d . isInvitationPending = checked
d . requestToJoinState = d . isInvitationPending ? Constants.RequestToJoinState.Requested : Constants . RequestToJoinState . None
}
2023-02-02 15:27:37 +00:00
}
}
ColumnLayout {
2024-04-04 16:03:10 +00:00
visible: d . requestToJoinState === Constants . RequestToJoinState . None
2023-02-02 15:27:37 +00:00
Label {
Layout.fillWidth: true
text: "Access type:"
}
RadioButton {
checked: true
text: qsTr ( "Public access" )
onCheckedChanged: d . accessType = Constants . communityChatPublicAccess
}
RadioButton {
text: qsTr ( "On request" )
onCheckedChanged: d . accessType = Constants . communityChatOnRequestAccess
}
}
2023-02-01 17:33:56 +00:00
// Join community overlay editor:
Label {
Layout.fillWidth: true
text: "JOIN HOLDINGS EDITOR"
font.bold: true
font.pixelSize: 18
}
JoinCommunityPermissionsEditor {
channelName: d . chanelName
joinCommunity: d . joinCommunity
requirementsMet: d . requirementsMet
2024-04-04 16:03:10 +00:00
isInvitationPending: d . requestToJoinState !== Constants . RequestToJoinState . None
2023-02-01 17:33:56 +00:00
isJoinRequestRejected: d . isJoinRequestRejected
requiresRequest: d . requiresRequest
onChannelNameChanged: d . channelName = channelName
onJoinCommunityChanged: d . joinCommunity = joinCommunity
onRequirementsMetChanged: d . requirementsMet = requirementsMet
onIsInvitationPendingChanged: d . isInvitationPending = isInvitationPending
onIsJoinRequestRejectedChanged: d . isJoinRequestRejected = isJoinRequestRejected
onRequiresRequestChanged: d . requiresRequest = requiresRequest
2023-02-14 16:33:23 +00:00
onCommunityHoldingsModelChanged: d . communityHoldingsModel = communityHoldingsModel
onViewOnlyHoldingsModelChanged: d . viewOnlyHoldingsModel = viewOnlyHoldingsModel
onViewAndPostHoldingsModelChanged: d . viewAndPostHoldingsModel = viewAndPostHoldingsModel
onModerateHoldingsModelChanged: d . moderateHoldingsModel = moderateHoldingsModel
2023-02-01 17:33:56 +00:00
}
}
}
}
}
2023-07-31 12:21:14 +00:00
// category: Views
2023-10-03 11:56:30 +00:00
// https://www.figma.com/file/17fc13UBFvInrLgNUKJJg5/Kuba%E2%8E%9CDesktop?node-id=2365%3A317901&t=05yQWHWBWOs2DUTp-0
// https://www.figma.com/file/17fc13UBFvInrLgNUKJJg5/Kuba%E2%8E%9CDesktop?node-id=2698%3A380426&t=UOvsb3QLi26KmVrk-0
// https://www.figma.com/file/17fc13UBFvInrLgNUKJJg5/Kuba%E2%8E%9CDesktop?node-id=2365%3A291788&t=UOvsb3QLi26KmVrk-0