-
-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: Turn page titles into dropdown for better navigation
- Loading branch information
1 parent
8feea2b
commit bdbf159
Showing
4 changed files
with
38 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
import { Dropdown, Icon, Menu } from "@grafana/ui" | ||
import React from "react" | ||
|
||
const menu = ( | ||
<Menu> | ||
<Menu.Item | ||
label="Clusters" | ||
url="/a/k8s-app/clusters" | ||
description="View cluster details" | ||
/> | ||
<Menu.Item | ||
label="Workloads" | ||
url="/a/k8s-app/workloads" | ||
description="Explore workloads in your cluster" | ||
/> | ||
<Menu.Item | ||
label="Network" | ||
url="/a/k8s-app/network" | ||
description="Explore network details" | ||
/> | ||
</Menu> | ||
) | ||
|
||
export function TitleNavigation(title: string) { | ||
return ( | ||
<Dropdown overlay={menu} placement="left-start"> | ||
<a className="ant-dropdown-link" onClick={e => e.preventDefault()}> | ||
<h1>{title}<Icon style={{marginLeft: '8px'}} name="angle-down"></Icon></h1> | ||
</a> | ||
</Dropdown> | ||
) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters