|
1 | 1 | // @flow |
2 | 2 |
|
3 | | -import React, { useRef, useCallback } from "react" |
4 | | -import type { Node } from "react" |
| 3 | +import type { Action, MainLayoutState } from "./types" |
| 4 | +import { FullScreen, useFullScreenHandle } from "react-full-screen" |
| 5 | +import React, { useCallback, useRef } from "react" |
5 | 6 | import { makeStyles, styled } from "@material-ui/core/styles" |
| 7 | + |
| 8 | +import ClassSelectionMenu from "../ClassSelectionMenu" |
| 9 | +import DebugBox from "../DebugSidebarBox" |
| 10 | +import HistorySidebarBox from "../HistorySidebarBox" |
6 | 11 | import ImageCanvas from "../ImageCanvas" |
7 | | -import styles from "./styles" |
8 | | -import type { MainLayoutState, Action } from "./types" |
9 | | -import useKey from "use-key-hook" |
10 | | -import classnames from "classnames" |
11 | | -import { useSettings } from "../SettingsProvider" |
12 | | -import SettingsDialog from "../SettingsDialog" |
13 | | -// import Fullscreen from "../Fullscreen" |
14 | | -import { FullScreen, useFullScreenHandle } from "react-full-screen" |
15 | | -import getActiveImage from "../Annotator/reducers/get-active-image" |
16 | | -import useImpliedVideoRegions from "./use-implied-video-regions" |
17 | | -import { useDispatchHotkeyHandlers } from "../ShortcutsManager" |
18 | | -import { withHotKeys } from "react-hotkeys" |
19 | | -import iconDictionary from "./icon-dictionary" |
| 12 | +import ImageSelector from "../ImageSelectorSidebarBox" |
20 | 13 | import KeyframeTimeline from "../KeyframeTimeline" |
21 | | -import Workspace from "react-material-workspace-layout/Workspace" |
22 | | -import DebugBox from "../DebugSidebarBox" |
23 | | -import TagsSidebarBox from "../TagsSidebarBox" |
24 | 14 | import KeyframesSelector from "../KeyframesSelectorSidebarBox" |
25 | | -import TaskDescription from "../TaskDescriptionSidebarBox" |
| 15 | +import type { Node } from "react" |
26 | 16 | import RegionSelector from "../RegionSelectorSidebarBox" |
27 | | -import ImageSelector from "../ImageSelectorSidebarBox" |
28 | | -import HistorySidebarBox from "../HistorySidebarBox" |
29 | | -import useEventCallback from "use-event-callback" |
| 17 | +import SettingsDialog from "../SettingsDialog" |
| 18 | +import TagsSidebarBox from "../TagsSidebarBox" |
| 19 | +import TaskDescription from "../TaskDescriptionSidebarBox" |
| 20 | +import Workspace from "react-material-workspace-layout/Workspace" |
| 21 | +import classnames from "classnames" |
| 22 | +import getActiveImage from "../Annotator/reducers/get-active-image" |
30 | 23 | import getHotkeyHelpText from "../utils/get-hotkey-help-text" |
31 | | -import ClassSelectionMenu from "../ClassSelectionMenu" |
| 24 | +import iconDictionary from "./icon-dictionary" |
| 25 | +import styles from "./styles" |
| 26 | +import { useDispatchHotkeyHandlers } from "../ShortcutsManager" |
| 27 | +import useEventCallback from "use-event-callback" |
| 28 | +import useImpliedVideoRegions from "./use-implied-video-regions" |
| 29 | +import useKey from "use-key-hook" |
| 30 | +import { useSettings } from "../SettingsProvider" |
| 31 | +import { withHotKeys } from "react-hotkeys" |
| 32 | + |
| 33 | +// import Fullscreen from "../Fullscreen" |
32 | 34 |
|
33 | 35 | const emptyArr = [] |
34 | 36 | const useStyles = makeStyles(styles) |
@@ -70,6 +72,10 @@ export const MainLayout = ({ |
70 | 72 | hideHeaderText, |
71 | 73 | hideNext = false, |
72 | 74 | hidePrev = false, |
| 75 | + hideClone = false, |
| 76 | + hideSettings = false, |
| 77 | + hideFullScreen = false, |
| 78 | + hideSave = false |
73 | 79 | }: Props) => { |
74 | 80 | const classes = useStyles() |
75 | 81 | const settings = useSettings() |
@@ -256,10 +262,10 @@ export const MainLayout = ({ |
256 | 262 | : !state.videoPlaying |
257 | 263 | ? { name: "Play" } |
258 | 264 | : { name: "Pause" }, |
259 | | - !nextImageHasRegions && activeImage.regions && { name: "Clone" }, |
260 | | - { name: "Settings" }, |
261 | | - state.fullScreen ? { name: "Window" } : { name: "Fullscreen" }, |
262 | | - { name: "Save" }, |
| 265 | + !hideClone && !nextImageHasRegions && activeImage.regions && { name: "Clone" }, |
| 266 | + !hideSettings && { name: "Settings" }, |
| 267 | + !hideFullScreen && (state.fullScreen ? { name: "Window" } : { name: "Fullscreen" }), |
| 268 | + !hideSave && { name: "Save" }, |
263 | 269 | ].filter(Boolean)} |
264 | 270 | onClickHeaderItem={onClickHeaderItem} |
265 | 271 | onClickIconSidebarItem={onClickIconSidebarItem} |
|
0 commit comments