-
-
Notifications
You must be signed in to change notification settings - Fork 303
/
ActionMenu.tsx
44 lines (40 loc) · 1.3 KB
/
ActionMenu.tsx
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
// keys aren't required for the dropdown menu items
/* eslint-disable react/jsx-key */
import { ReactElement } from "react";
import scssVariables from "@react-md/app-bar/dist/scssVariables";
import { MoreVertSVGIcon } from "@react-md/material-icons";
import { DropdownMenu } from "@react-md/menu";
import { unitToNumber } from "@react-md/utils";
import { CodePreferenceToggle } from "components/CodePreference";
import ToggleTheme from "./ToggleTheme";
import ToggleRTL from "./ToggleRTL";
import GithubLink from "./GithubLink";
import TableOfContentsMenuItem from "./TableOfContentsMenuItem";
import PreviousDocsMenuItems from "./PreviousDocsMenuItems";
const margin = unitToNumber(scssVariables["rmd-app-bar-lr-margin"]);
const options = {
vwMargin: margin,
vhMargin: margin,
};
export default function ActionMenu(): ReactElement {
return (
<DropdownMenu
id="main-app-actions"
aria-label="Actions"
menuLabel="Actions"
buttonType="icon"
items={[
<ToggleTheme as="menuitem" />,
<ToggleRTL as="menuitem" />,
<CodePreferenceToggle as="menuitem" />,
<PreviousDocsMenuItems />,
<GithubLink as="menuitem" />,
<TableOfContentsMenuItem />,
]}
last
positionOptions={options}
>
<MoreVertSVGIcon />
</DropdownMenu>
);
}