diff --git a/storybook/PagesModel.qml b/storybook/PagesModel.qml index d7ac97618e..4c7c394d16 100644 --- a/storybook/PagesModel.qml +++ b/storybook/PagesModel.qml @@ -57,6 +57,10 @@ ListModel { title: "HoldingsDropdown" section: "Popups" } + ListElement { + title: "InDropdown" + section: "Popups" + } ListElement { title: "MembersSelector" section: "Components" diff --git a/storybook/figma.json b/storybook/figma.json index 6dd8318a08..7d3b7e44d8 100644 --- a/storybook/figma.json +++ b/storybook/figma.json @@ -29,6 +29,14 @@ "https://www.figma.com/file/17fc13UBFvInrLgNUKJJg5/Kuba%E2%8E%9CDesktop?node-id=2975%3A489607", "https://www.figma.com/file/17fc13UBFvInrLgNUKJJg5/Kuba%E2%8E%9CDesktop?node-id=2975%3A492910" ], + "InDropdown": [ + "https://www.figma.com/file/17fc13UBFvInrLgNUKJJg5/Kuba%E2%8E%9CDesktop?node-id=2934%3A482182", + "https://www.figma.com/file/17fc13UBFvInrLgNUKJJg5/Kuba%E2%8E%9CDesktop?node-id=2934%3A482231", + "https://www.figma.com/file/17fc13UBFvInrLgNUKJJg5/Kuba%E2%8E%9CDesktop?node-id=2934%3A482280", + "https://www.figma.com/file/17fc13UBFvInrLgNUKJJg5/Kuba%E2%8E%9CDesktop?node-id=2934%3A481935", + "https://www.figma.com/file/17fc13UBFvInrLgNUKJJg5/Kuba%E2%8E%9CDesktop?node-id=2934%3A482006", + "https://www.figma.com/file/17fc13UBFvInrLgNUKJJg5/Kuba%E2%8E%9CDesktop?node-id=2934%3A482016" + ], "InviteFriendsToCommunityPopup": [ "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", diff --git a/storybook/pages/InDropdownPage.qml b/storybook/pages/InDropdownPage.qml new file mode 100644 index 0000000000..056e4a0d40 --- /dev/null +++ b/storybook/pages/InDropdownPage.qml @@ -0,0 +1,127 @@ +import QtQuick 2.14 +import QtQuick.Controls 2.14 + +import AppLayouts.Chat.controls.community 1.0 + +import Models 1.0 + +import Storybook 1.0 + +SplitView { + id: root + + orientation: Qt.Vertical + + Logs { id: logs } + + Pane { + id: pane + + SplitView.fillWidth: true + SplitView.fillHeight: true + + ListModel { + id: chatsModel + + ListElement { + itemId: 0 + name: "welcome" + isCategory: false + color: "" + colorId: 1 + icon: "" + } + ListElement { + itemId: 1 + name: "announcements" + isCategory: false + color: "" + colorId: 1 + icon: "" + } + ListElement { + name: "Discussion" + isCategory: true + + subItems: [ + ListElement { + itemId: 2 + name: "general" + icon: "" + emoji: "👋" + }, + ListElement { + itemId: 3 + name: "help" + icon: "" + color: "" + colorId: 1 + emoji: "⚽" + } + ] + } + ListElement { + name: "Support" + isCategory: true + + subItems: [ + ListElement { + itemId: 4 + name: "faq" + icon: "" + color: "" + colorId: 1 + }, + ListElement { + itemId: 5 + name: "report-scam" + icon: "" + color: "" + colorId: 1 + } + ] + } + ListElement { + name: "Empty" + isCategory: true + + subItems: [] + } + } + + InDropdown { + parent: pane + anchors.centerIn: parent + + communityName: "Socks" + communityImage: ModelsData.icons.socks + communityColor: "red" + + model: chatsModel + + onAddChannelClicked: { + logs.logEvent("InDropdown::addChannelClicked") + } + + onCommunitySelected: { + logs.logEvent("InDropdown::communitySelected") + } + + onChannelsSelected: { + logs.logEvent("InDropdown::channelSelected", ["channels"], arguments) + } + + onOpened: contentItem.parent.parent = pane + Component.onCompleted: open() + } + } + + LogsAndControlsPanel { + id: logsAndControlsPanel + + SplitView.minimumHeight: 100 + SplitView.preferredHeight: 200 + + logsView.logText: logs.logText + } +}