refactor: make Sticker a Loader so that we only load it if needed

This commit is contained in:
Jonathan Rainville 2020-09-30 13:49:14 -04:00 committed by Iuri Matias
parent edfd952166
commit df76fb815b
1 changed files with 14 additions and 6 deletions

View File

@ -2,10 +2,18 @@ import QtQuick 2.3
import "../../../../../shared" as Shared import "../../../../../shared" as Shared
import "../../../../../imports" import "../../../../../imports"
Shared.ImageLoader { Loader {
id: stickerId property color color
visible: contentType === Constants.stickerType
width: 140 id: root
height: this.visible ? 140 : 0 active: contentType === Constants.stickerType
source: this.visible ? ("https://ipfs.infura.io/ipfs/" + sticker) : ""
sourceComponent: Component {
Shared.ImageLoader {
color: root.color
width: 140
height: this.visible ? 140 : 0
source: this.visible ? ("https://ipfs.infura.io/ipfs/" + sticker) : ""
}
}
} }