From fc264f0601b6a9650ab392cdcc91d14062fa0874 Mon Sep 17 00:00:00 2001 From: IlarionHalushka Date: Thu, 27 Jun 2019 19:16:05 +0300 Subject: [PATCH] [IMPROVEMENT] Hide frequently used emoji tab when empty (#792) --- app/containers/EmojiPicker/index.js | 22 ++++++++++++---------- 1 file changed, 12 insertions(+), 10 deletions(-) diff --git a/app/containers/EmojiPicker/index.js b/app/containers/EmojiPicker/index.js index 3fe6f9371..cfe572559 100644 --- a/app/containers/EmojiPicker/index.js +++ b/app/containers/EmojiPicker/index.js @@ -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,15 +155,17 @@ export default class EmojiPicker extends Component { > { categories.tabs.map((tab, i) => ( - - {this.renderCategory(tab.category, i)} - - )) + (i === 0 && frequentlyUsed.length === 0) ? null // when no frequentlyUsed don't show the tab + : ( + + {this.renderCategory(tab.category, i)} + + ))) } );