[IMPROVEMENT] Hide frequently used emoji tab when empty (#792)
This commit is contained in:
parent
636518b6b3
commit
fc264f0601
|
@ -141,7 +141,7 @@ export default class EmojiPicker extends Component {
|
|||
}
|
||||
|
||||
render() {
|
||||
const { show } = this.state;
|
||||
const { show, frequentlyUsed } = this.state;
|
||||
const { tabEmojiStyle } = this.props;
|
||||
|
||||
if (!show) {
|
||||
|
@ -155,6 +155,8 @@ export default class EmojiPicker extends Component {
|
|||
>
|
||||
{
|
||||
categories.tabs.map((tab, i) => (
|
||||
(i === 0 && frequentlyUsed.length === 0) ? null // when no frequentlyUsed don't show the tab
|
||||
: (
|
||||
<ScrollView
|
||||
key={tab.category}
|
||||
tabLabel={tab.tabLabel}
|
||||
|
@ -163,7 +165,7 @@ export default class EmojiPicker extends Component {
|
|||
>
|
||||
{this.renderCategory(tab.category, i)}
|
||||
</ScrollView>
|
||||
))
|
||||
)))
|
||||
}
|
||||
</ScrollableTabView>
|
||||
);
|
||||
|
|
Loading…
Reference in New Issue