2
0
mirror of synced 2025-02-08 04:33:42 +00:00
status-qml/sandbox/pages/StatusCommunityCardPage.qml
Noelia 46cd904ced
feat(StatusCommunityCard): First component iteration (#693)
It includes logo, title, community members, description, loaded, community id, popularity, tags row (that must be replaced to a new StatusQ component `StatusListItemTagRow`.

It also contains `locale` property used to decide the member's number format.

Added loading card.

Added Community Card page (components test) and view (demo app) in sandbox.

Added component documentation.

Part of task: https://github.com/status-im/status-desktop/issues/4936
2022-05-31 11:44:26 +02:00

44 lines
1.1 KiB
QML

import QtQuick 2.0
import QtQuick.Layouts 1.13
import StatusQ.Components 0.1
import "../demoapp/data" 1.0
GridLayout {
QtObject {
id: d
function navigateToCommunity(communityID) {
console.log("Clicked community: " + communityID)
}
}
Layout.alignment: Qt.AlignHCenter | Qt.AlignVCenter
columns: 2
columnSpacing: 16
rowSpacing: 16
Repeater {
model: Models.curatedCommunitiesModel
delegate: StatusCommunityCard {
locale: "en"
communityId: model.communityId
loaded: model.available
logo: model.icon
name: model.name
description: model.description
members: model.members
popularity: model.popularity
categories: ListModel {
ListElement { name: "sport"; emoji: "🎾"}
ListElement { name: "food"; emoji: "🥑"}
ListElement { name: "privacy"; emoji: "👻"}
}
onClicked: { d.navigateToCommunity(communityId) }
}
}
}