feat(Storybook): First sample page (CommunitiesPortalLayout)

This commit is contained in:
Michał Cieślak 2022-10-04 23:51:14 +02:00 committed by Michał
parent 38299f7169
commit 2b6150177b
8 changed files with 192 additions and 1 deletions

View File

@ -34,6 +34,12 @@ ApplicationWindow {
Column { Column {
id: navigation id: navigation
spacing: 0 spacing: 0
StatusNavigationListItem {
title: "CommunitiesPortalLayout"
selected: viewLoader.source.toString().includes(title)
onClicked: mainPageView.page(title);
}
} }
} }

File diff suppressed because one or more lines are too long

View File

@ -0,0 +1,57 @@
import QtQuick 2.14
import QtQuick.Controls 2.14
import QtQuick.Layouts 1.14
import AppLayouts.CommunitiesPortal 1.0
import AppLayouts.CommunitiesPortal.stores 1.0
import SortFilterProxyModel 0.2
ColumnLayout{
anchors.fill: parent
CommunitiesPortalLayout {
Layout.fillWidth: true
Layout.fillHeight: true
communitiesStore: CommunitiesStore {
readonly property string locale: ""
readonly property int unreadNotificationsCount: 42
readonly property string communityTags:
JSON.stringify({"Activism":"✊","Art":"🎨","Blockchain":"🔗","Books & blogs":"📚","Career":"💼"})
readonly property var curatedCommunitiesModel: SortFilterProxyModel {
sourceModel: CommunitiesPortalDummyModel {}
filters: IndexFilter {
inverted: true
minimumIndex: Math.floor(slider.value)
}
}
}
}
Rectangle {
color: 'gray'
Layout.preferredHeight: 1
Layout.fillWidth: true
}
Pane {
Row {
Text {
anchors.verticalCenter: parent.verticalCenter
text: "number of communities:"
}
Slider {
id: slider
value: 9
from: 0
to: 9
}
}
}
}

View File

@ -1,5 +1,7 @@
<RCC> <RCC>
<qresource prefix="/"> <qresource prefix="/">
<file>main.qml</file> <file>main.qml</file>
<file>pages/CommunitiesPortalLayoutPage.qml</file>
<file>pages/CommunitiesPortalDummyModel.qml</file>
</qresource> </qresource>
</RCC> </RCC>

View File

@ -0,0 +1,3 @@
import QtQuick 2.13
QtObject {}

View File

@ -0,0 +1 @@
CommunitiesStore 1.0 CommunitiesStore.qml

View File

@ -16,8 +16,9 @@ import shared.panels 1.0
import SortFilterProxyModel 0.2 import SortFilterProxyModel 0.2
import AppLayouts.CommunitiesPortal.stores 1.0
import "controls" import "controls"
import "stores"
import "popups" import "popups"
import "views" import "views"

View File

@ -0,0 +1 @@
CommunitiesStore 1.0 CommunitiesStore.qml