emoji-picker-react 4.20.8 → 4.20.9
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/components/navigation/CategoryNavigation.d.ts +1 -1
- package/dist/emoji-picker-react.cjs.development.js +9 -4
- package/dist/emoji-picker-react.cjs.development.js.map +1 -1
- package/dist/emoji-picker-react.cjs.production.min.js +1 -1
- package/dist/emoji-picker-react.cjs.production.min.js.map +1 -1
- package/dist/emoji-picker-react.esm.js +9 -4
- package/dist/emoji-picker-react.esm.js.map +1 -1
- package/package.json +1 -1
- package/src/components/navigation/CategoryNavigation.tsx +12 -5
package/package.json
CHANGED
|
@@ -31,6 +31,17 @@ export function CategoryNavigation() {
|
|
|
31
31
|
const CategoryNavigationRef = useCategoryNavigationRef();
|
|
32
32
|
const hideCustomCategory = useShouldHideCustomEmojis();
|
|
33
33
|
|
|
34
|
+
const visibleCategories = categoriesConfig.filter(
|
|
35
|
+
categoryConfig =>
|
|
36
|
+
!(isCustomCategory(categoryConfig) && hideCustomCategory),
|
|
37
|
+
);
|
|
38
|
+
|
|
39
|
+
// A single tab navigates nowhere — hide the bar to reclaim its space.
|
|
40
|
+
// https://github.com/ealush/emoji-picker-react/issues/396
|
|
41
|
+
if (visibleCategories.length <= 1) {
|
|
42
|
+
return null;
|
|
43
|
+
}
|
|
44
|
+
|
|
34
45
|
return (
|
|
35
46
|
<div
|
|
36
47
|
className={cx(styles.nav)}
|
|
@@ -39,14 +50,10 @@ export function CategoryNavigation() {
|
|
|
39
50
|
id="epr-category-nav-id"
|
|
40
51
|
ref={CategoryNavigationRef}
|
|
41
52
|
>
|
|
42
|
-
{
|
|
53
|
+
{visibleCategories.map(categoryConfig => {
|
|
43
54
|
const category = categoryFromCategoryConfig(categoryConfig);
|
|
44
55
|
const isActiveCategory = category === activeCategory;
|
|
45
56
|
|
|
46
|
-
if (isCustomCategory(categoryConfig) && hideCustomCategory) {
|
|
47
|
-
return null;
|
|
48
|
-
}
|
|
49
|
-
|
|
50
57
|
const allowNavigation = !isSearchMode && !isActiveCategory;
|
|
51
58
|
|
|
52
59
|
return (
|