-
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathTopNav.tsx
More file actions
54 lines (50 loc) · 1.13 KB
/
TopNav.tsx
File metadata and controls
54 lines (50 loc) · 1.13 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
import {
Alignment,
Button,
Classes,
Menu,
MenuDivider,
MenuItem,
Navbar,
Popover,
} from '@blueprintjs/core'
import { FixedWidthContainer } from './FixedWidthContainer'
export function TopNav() {
return (
<Navbar className={Classes.DARK} fixedToTop>
<FixedWidthContainer>
<Navbar.Group align={Alignment.LEFT}>
<Navbar.Heading>XIV 文本检索</Navbar.Heading>
</Navbar.Group>
<Navbar.Group align={Alignment.RIGHT}>
<MoreToolsButton />
</Navbar.Group>
</FixedWidthContainer>
</Navbar>
)
}
function MoreToolsButton() {
return (
<Popover content={<MoreToolsMenu />}>
<Button icon="more" intent="primary" />
</Popover>
)
}
const FFCAFE_URL = 'https://www.ffcafe.cn'
function MoreToolsMenu() {
return (
<Menu>
<MenuDivider title="关于" />
<MenuItem
text="FFCAFE"
icon="globe"
onClick={() => window.open(FFCAFE_URL, '_blank')}
/>
<MenuItem
text="闲聊群 612370226"
onClick={() => navigator.clipboard.writeText('612370226')}
icon="chat"
/>
</Menu>
)
}