-
-
Notifications
You must be signed in to change notification settings - Fork 303
/
SandboxNavigation.tsx
59 lines (54 loc) · 1.45 KB
/
SandboxNavigation.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
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
import React, { FC } from "react";
import { AppBar, AppBarTitle, AppBarAction } from "@react-md/app-bar";
import { MenuSVGIcon } from "@react-md/material-icons";
import { bem } from "@react-md/theme";
import { MobileOnly } from "@react-md/utils";
import AppBarNav from "components/AppBarNav";
interface SandboxNavigationProps {
name: string;
from: string;
fileName: string;
onRequestFiles: () => void;
onRequestClose: () => void;
}
const block = bem("sandbox-modal");
const SandboxNavigation: FC<SandboxNavigationProps> = ({
name,
from,
fileName,
onRequestFiles,
onRequestClose,
}) => {
return (
<AppBar prominent dense theme="default" className={block("header")}>
<AppBar>
<MobileOnly>
<AppBarNav
id="sandbox-dialog-file-tree-toggle"
tooltip="Show Files"
aria-label="Show Files"
onClick={onRequestFiles}
>
<MenuSVGIcon />
</AppBarNav>
</MobileOnly>
<AppBarTitle id="sandbox-dialog-title" noWrap>
{name}
</AppBarTitle>
<AppBarAction
id="sandbox-dialog-close"
first
last
buttonType="text"
onClick={onRequestClose}
>
{from ? "Go Back" : "Close"}
</AppBarAction>
</AppBar>
<code className={block("breadcrumbs")}>
{fileName.replace(/\//g, " / ")}
</code>
</AppBar>
);
};
export default SandboxNavigation;