[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() {
|
render() {
|
||||||
const { show } = this.state;
|
const { show, frequentlyUsed } = this.state;
|
||||||
const { tabEmojiStyle } = this.props;
|
const { tabEmojiStyle } = this.props;
|
||||||
|
|
||||||
if (!show) {
|
if (!show) {
|
||||||
|
@ -155,15 +155,17 @@ export default class EmojiPicker extends Component {
|
||||||
>
|
>
|
||||||
{
|
{
|
||||||
categories.tabs.map((tab, i) => (
|
categories.tabs.map((tab, i) => (
|
||||||
<ScrollView
|
(i === 0 && frequentlyUsed.length === 0) ? null // when no frequentlyUsed don't show the tab
|
||||||
key={tab.category}
|
: (
|
||||||
tabLabel={tab.tabLabel}
|
<ScrollView
|
||||||
style={styles.background}
|
key={tab.category}
|
||||||
{...scrollProps}
|
tabLabel={tab.tabLabel}
|
||||||
>
|
style={styles.background}
|
||||||
{this.renderCategory(tab.category, i)}
|
{...scrollProps}
|
||||||
</ScrollView>
|
>
|
||||||
))
|
{this.renderCategory(tab.category, i)}
|
||||||
|
</ScrollView>
|
||||||
|
)))
|
||||||
}
|
}
|
||||||
</ScrollableTabView>
|
</ScrollableTabView>
|
||||||
);
|
);
|
||||||
|
|
Loading…
Reference in New Issue