chore(Storybook): page for ContactsListAndSearch added

This commit is contained in:
Michał Cieślak 2022-12-01 23:52:45 +01:00 committed by Michał
parent 1e086de456
commit 55668f160c
4 changed files with 175 additions and 0 deletions

View File

@ -53,6 +53,10 @@ ListModel {
title: "ImagesGridView"
section: "Components"
}
ListElement {
title: "ContactsListAndSearch"
section: "Components"
}
ListElement {
title: "BrowserSettings"
section: "Settings"

View File

@ -0,0 +1,163 @@
import QtQuick 2.14
import QtQuick.Controls 2.14
import shared.controls 1.0
import shared.stores 1.0
import utils 1.0
Pane {
QtObject {
id: userProfileInst
Component.onCompleted: RootStore.userProfileInst = userProfileInst
}
QtObject {
id: chatSectionChatContentInputArea
}
QtObject {
id: mainModule
signal resolvedENS
}
QtObject {
id: globalUtilsInst
function isCompressedPubKey() {
return true
}
function getCompressedPk(publicKey) {
return "zx3sh" + publicKey
}
Component.onCompleted: Utils.globalUtilsInst = globalUtilsInst
}
QtObject {
id: mainModuleInst
function isCompressedPubKey() {
return true
}
function getContactDetailsAsJson() {
return JSON.stringify({
alias: "alias",
isAdded: false
})
}
Component.onCompleted: Utils.mainModuleInst = mainModuleInst
}
ContactsListAndSearch {
anchors.fill: parent
community: ({ id: "communityId" })
contactsStore: QtObject {
readonly property ListModel myContactsModel: ListModel {
ListElement {
pubKey: "0x02342342342"
isContact: true
onlineStatus: true
displayName: "x1"
icon: ""
colorId: 0
ensName: "ens name"
isBlocked: false
alias: "some alias"
localNickname: "l1"
}
ListElement {
pubKey: "0x02342342342"
isContact: true
onlineStatus: true
displayName: "x2 sdfsd"
icon: ""
colorId: 0
ensName: "ens name"
isBlocked: false
alias: "some alias"
localNickname: ""
}
ListElement {
pubKey: "0x02342342342"
isContact: true
onlineStatus: true
displayName: "x3 xcvxcv"
icon: ""
colorId: 0
ensName: "ens name"
isBlocked: false
alias: "some alias"
localNickname: ""
}
ListElement {
pubKey: "0x02342342342"
isContact: true
onlineStatus: true
displayName: "x4 drt5"
icon: ""
colorId: 0
ensName: "ens name"
isBlocked: false
alias: "some alias"
localNickname: ""
}
ListElement {
pubKey: "0x02342342342"
isContact: true
onlineStatus: true
displayName: "x4 drt5e"
icon: ""
colorId: 0
ensName: "ens name"
isBlocked: false
alias: "some alias"
localNickname: ""
}
ListElement {
pubKey: "0x02342342342"
isContact: true
onlineStatus: true
displayName: "x4 drtew5"
icon: ""
colorId: 0
ensName: "ens name"
isBlocked: false
alias: "some alias"
localNickname: ""
}
ListElement {
pubKey: "0x02342342342"
isContact: true
onlineStatus: true
displayName: "x4 drt5e"
icon: ""
colorId: 0
ensName: "ens name"
isBlocked: false
alias: "some alias"
localNickname: ""
}
ListElement {
pubKey: "0x02342342342"
isContact: true
onlineStatus: true
displayName: "x4 drtew5"
icon: ""
colorId: 0
ensName: "ens name"
isBlocked: false
alias: "some alias"
localNickname: ""
}
}
}
}
}

View File

@ -0,0 +1,7 @@
pragma Singleton
import QtQuick 2.14
QtObject {
property var userProfileInst
}

View File

@ -0,0 +1 @@
singleton RootStore 1.0 RootStore.qml