Skip to content

Commit

Permalink
[IMPROVEMENT] Hide frequently used emoji tab when empty (#792)
Browse files Browse the repository at this point in the history
  • Loading branch information
IlarionHalushka authored and diegolmello committed Jun 27, 2019
1 parent a5b8ced commit 26fb23e
Showing 1 changed file with 12 additions and 10 deletions.
22 changes: 12 additions & 10 deletions app/containers/EmojiPicker/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand All @@ -155,15 +155,17 @@ export default class EmojiPicker extends Component {
>
{
categories.tabs.map((tab, i) => (
<ScrollView
key={tab.category}
tabLabel={tab.tabLabel}
style={styles.background}
{...scrollProps}
>
{this.renderCategory(tab.category, i)}
</ScrollView>
))
(i === 0 && frequentlyUsed.length === 0) ? null // when no frequentlyUsed don't show the tab
: (
<ScrollView
key={tab.category}
tabLabel={tab.tabLabel}
style={styles.background}
{...scrollProps}
>
{this.renderCategory(tab.category, i)}
</ScrollView>
)))
}
</ScrollableTabView>
);
Expand Down

0 comments on commit 26fb23e

Please sign in to comment.