@campfire-interactive/shell-header 0.8.3 → 0.8.5

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.
Files changed (2) hide show
  1. package/dist/index.js +2 -1
  2. package/package.json +1 -1
package/dist/index.js CHANGED
@@ -330,6 +330,7 @@ function UserMenu({
330
330
  }
331
331
  const showTenant = tenant !== void 0;
332
332
  const canSwitchTenant = showTenant && onTenantSwitch !== void 0 && Array.isArray(tenants) && tenants.length > 1;
333
+ const sortedTenants = canSwitchTenant ? [...tenants].sort((a, b) => a.name.localeCompare(b.name)) : [];
333
334
  async function handleTenantSelect(tenantId) {
334
335
  if (!onTenantSwitch || tenantId === tenant?.id) {
335
336
  setTenantExpanded(false);
@@ -386,7 +387,7 @@ function UserMenu({
386
387
  /* @__PURE__ */ jsx4(Building2, { size: 14 }),
387
388
  /* @__PURE__ */ jsx4("span", { className: "cfi-sh-locale-row-label", children: tenant.name })
388
389
  ] }),
389
- canSwitchTenant && tenantExpanded && /* @__PURE__ */ jsx4("div", { className: "cfi-sh-locale-sublist", children: tenants.map((t) => {
390
+ canSwitchTenant && tenantExpanded && /* @__PURE__ */ jsx4("div", { className: "cfi-sh-locale-sublist", children: sortedTenants.map((t) => {
390
391
  const active = t.id === tenant.id;
391
392
  return /* @__PURE__ */ jsxs4(
392
393
  "button",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@campfire-interactive/shell-header",
3
- "version": "0.8.3",
3
+ "version": "0.8.5",
4
4
  "description": "Shared shell header with app switcher for Campfire Suite",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",