@zmzai/theme 0.5.0 → 0.5.1
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
|
@@ -32,6 +32,8 @@ export interface NavbarProps {
|
|
|
32
32
|
actions?: ReactNode;
|
|
33
33
|
/** 品牌区右侧的附属徽章(如域名 a.zmzai.cloud) */
|
|
34
34
|
badge?: ReactNode;
|
|
35
|
+
/** 品牌区点击链接(通常回首页,如 "/");不传则品牌区不可点击 */
|
|
36
|
+
brandHref?: string;
|
|
35
37
|
className?: string;
|
|
36
38
|
}
|
|
37
39
|
|
|
@@ -48,7 +50,13 @@ export interface NavbarProps {
|
|
|
48
50
|
* <Link href="/audit" className={navItemClass(pathname === "/audit")}>运行审计</Link>
|
|
49
51
|
* </Navbar>
|
|
50
52
|
*/
|
|
51
|
-
export function Navbar({ sublabel, brand, children, actions, badge, className }: NavbarProps) {
|
|
53
|
+
export function Navbar({ sublabel, brand, children, actions, badge, brandHref, className }: NavbarProps) {
|
|
54
|
+
const brandNode = brand ?? (
|
|
55
|
+
<span className="inline-flex items-center gap-2">
|
|
56
|
+
<Logo size={22} />
|
|
57
|
+
<Wordmark size={16} sublabel={sublabel} />
|
|
58
|
+
</span>
|
|
59
|
+
);
|
|
52
60
|
return (
|
|
53
61
|
<header
|
|
54
62
|
className={cn(
|
|
@@ -57,11 +65,12 @@ export function Navbar({ sublabel, brand, children, actions, badge, className }:
|
|
|
57
65
|
)}
|
|
58
66
|
>
|
|
59
67
|
<div className="flex min-w-0 items-center gap-2.5">
|
|
60
|
-
{
|
|
61
|
-
<
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
68
|
+
{brandHref ? (
|
|
69
|
+
<a href={brandHref} className="inline-flex items-center">
|
|
70
|
+
{brandNode}
|
|
71
|
+
</a>
|
|
72
|
+
) : (
|
|
73
|
+
brandNode
|
|
65
74
|
)}
|
|
66
75
|
{badge}
|
|
67
76
|
</div>
|