Hide blessed packs section if we don't have any blessed packs
This commit is contained in:
parent
058feb317c
commit
8677e8376a
2 changed files with 40 additions and 31 deletions
|
@ -55,7 +55,7 @@ const blessedPacks = packs.map(p => ({
|
|||
</util.ConversationContext>;
|
||||
```
|
||||
|
||||
#### No Advertised Packs
|
||||
#### Only installed packs
|
||||
|
||||
```jsx
|
||||
const sticker1 = { id: 1, url: util.kitten164ObjectUrl, packId: 'foo' };
|
||||
|
@ -107,7 +107,7 @@ const noPacks = [];
|
|||
</util.ConversationContext>;
|
||||
```
|
||||
|
||||
#### No Installed Packs
|
||||
#### Only received packs
|
||||
|
||||
```jsx
|
||||
const sticker1 = { id: 1, url: util.kitten164ObjectUrl, packId: 'foo' };
|
||||
|
@ -158,7 +158,7 @@ const noPacks = [];
|
|||
</util.ConversationContext>;
|
||||
```
|
||||
|
||||
#### No with 'known'
|
||||
#### Just installed and 'known'
|
||||
|
||||
```jsx
|
||||
const sticker1 = { id: 1, url: util.kitten164ObjectUrl, packId: 'foo' };
|
||||
|
@ -216,7 +216,7 @@ const noPacks = [];
|
|||
</util.ConversationContext>;
|
||||
```
|
||||
|
||||
#### No Packs at All
|
||||
#### No packs at All
|
||||
|
||||
```jsx
|
||||
const noPacks = [];
|
||||
|
|
|
@ -75,18 +75,26 @@ export const StickerManager = React.memo(
|
|||
i18nKey: 'stickers--StickerManager--InstalledPacks',
|
||||
i18nEmptyKey: 'stickers--StickerManager--InstalledPacks--Empty',
|
||||
packs: installedPacks,
|
||||
hideIfEmpty: false,
|
||||
},
|
||||
{
|
||||
i18nKey: 'stickers--StickerManager--BlessedPacks',
|
||||
i18nEmptyKey: 'stickers--StickerManager--BlessedPacks--Empty',
|
||||
packs: blessedPacks,
|
||||
hideIfEmpty: true,
|
||||
},
|
||||
{
|
||||
i18nKey: 'stickers--StickerManager--ReceivedPacks',
|
||||
i18nEmptyKey: 'stickers--StickerManager--ReceivedPacks--Empty',
|
||||
packs: receivedPacks,
|
||||
hideIfEmpty: false,
|
||||
},
|
||||
].map(section => (
|
||||
].map(section => {
|
||||
if (section.hideIfEmpty && section.packs.length === 0) {
|
||||
return;
|
||||
}
|
||||
|
||||
return (
|
||||
<React.Fragment key={section.i18nKey}>
|
||||
<h2
|
||||
className={classNames(
|
||||
|
@ -113,7 +121,8 @@ export const StickerManager = React.memo(
|
|||
</div>
|
||||
)}
|
||||
</React.Fragment>
|
||||
))}
|
||||
);
|
||||
})}
|
||||
</div>
|
||||
</>
|
||||
);
|
||||
|
|
Loading…
Reference in a new issue