@ansiversa/components 0.0.138 → 0.0.139
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/package.json
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
---
|
|
2
|
+
import { AppLogo } from "@ansiversa/components";
|
|
2
3
|
import type { MiniAppLink } from "./miniAppRegistry";
|
|
3
4
|
import { MINI_APP_REGISTRY } from "./miniAppRegistry";
|
|
4
5
|
|
|
@@ -9,8 +10,10 @@ interface Props {
|
|
|
9
10
|
|
|
10
11
|
const { appKey, links } = Astro.props as Props;
|
|
11
12
|
|
|
12
|
-
const
|
|
13
|
-
const
|
|
13
|
+
const normalizedAppKey = typeof appKey === "string" ? appKey.trim() : "";
|
|
14
|
+
const meta = normalizedAppKey ? MINI_APP_REGISTRY[normalizedAppKey] : undefined;
|
|
15
|
+
const appName = meta?.name ?? (normalizedAppKey || "App");
|
|
16
|
+
const showLogo = normalizedAppKey.length > 0;
|
|
14
17
|
|
|
15
18
|
let menuLinks = links ?? meta?.links ?? [];
|
|
16
19
|
if (!menuLinks.length) {
|
|
@@ -21,7 +24,10 @@ if (!menuLinks.length) {
|
|
|
21
24
|
<div class="av-mini-app-bar">
|
|
22
25
|
<div class="av-mini-app-bar__inner">
|
|
23
26
|
<div class="av-mini-app-bar__title" title={appName}>
|
|
24
|
-
<span class="av-mini-app-bar__name">
|
|
27
|
+
<span class="av-mini-app-bar__name flex items-center gap-2">
|
|
28
|
+
{showLogo && <AppLogo appId={normalizedAppKey} size="sm" />}
|
|
29
|
+
<span class="truncate">{appName}</span>
|
|
30
|
+
</span>
|
|
25
31
|
</div>
|
|
26
32
|
|
|
27
33
|
<div class="av-mini-app-bar__menu" x-data="{ open: false }">
|