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.
@@ -30598,18 +30598,23 @@ function CategoryNavigation() {
30598
30598
  var categoryIcons = useCategoryIconsConfig();
30599
30599
  var CategoryNavigationRef = useCategoryNavigationRef();
30600
30600
  var hideCustomCategory = useShouldHideCustomEmojis();
30601
+ var visibleCategories = categoriesConfig.filter(function (categoryConfig) {
30602
+ return !(isCustomCategory(categoryConfig) && hideCustomCategory);
30603
+ });
30604
+ // A single tab navigates nowhere — hide the bar to reclaim its space.
30605
+ // https://github.com/ealush/emoji-picker-react/issues/396
30606
+ if (visibleCategories.length <= 1) {
30607
+ return null;
30608
+ }
30601
30609
  return createElement("div", {
30602
30610
  className: cx(styles$g.nav),
30603
30611
  role: "tablist",
30604
30612
  "aria-label": "Category navigation",
30605
30613
  id: "epr-category-nav-id",
30606
30614
  ref: CategoryNavigationRef
30607
- }, categoriesConfig.map(function (categoryConfig) {
30615
+ }, visibleCategories.map(function (categoryConfig) {
30608
30616
  var category = categoryFromCategoryConfig(categoryConfig);
30609
30617
  var isActiveCategory = category === activeCategory;
30610
- if (isCustomCategory(categoryConfig) && hideCustomCategory) {
30611
- return null;
30612
- }
30613
30618
  var allowNavigation = !isSearchMode && !isActiveCategory;
30614
30619
  return createElement(CategoryButton, {
30615
30620
  key: category,