-
-
Notifications
You must be signed in to change notification settings - Fork 31
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* add controls group * squash * fix warning * adjust the test * resolve the package json conflict * adjust the hide end to end test * adjust the test id
- Loading branch information
1 parent
59bff6d
commit 7c7fc3e
Showing
23 changed files
with
667 additions
and
374 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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,76 @@ | ||
import React from 'react' | ||
import ButtonGroup from '@mui/material/ButtonGroup' | ||
import OpenModelControl from './OpenModelControl' | ||
import useStore from '../store/useStore' | ||
import {TooltipIconButton} from './Buttons' | ||
import HistoryIcon from '@mui/icons-material/History' | ||
import SearchIcon from '@mui/icons-material/Search' | ||
import TreeIcon from '../assets/icons/Tree.svg' | ||
|
||
|
||
/** | ||
* OperationsGroup contains tools for sharing, notes, properties, cut | ||
* plane, deselect, theme change and about. | ||
* | ||
* @property {Function} deselectItems deselects currently selected element | ||
* @return {React.Component} | ||
*/ | ||
export default function OperationsGroup({fileOpen, repo}) { | ||
const isNavigationVisible = useStore((state) => state.isNavigationVisible) | ||
const toggleIsNavigationVisible = useStore((state) => state.toggleIsNavigationVisible) | ||
const isSearchVisible = useStore((state) => state.isSearchVisible) | ||
const toggleIsSearchVisible = useStore((state) => state.toggleIsSearchVisible) | ||
const isVersionHistoryVisible = useStore((state) => state.isVersionHistoryVisible) | ||
const toggleIsVersionHistoryVisible = useStore((state) => state.toggleIsVersionHistoryVisible) | ||
|
||
|
||
return ( | ||
<ButtonGroup | ||
orientation='horizontal' | ||
variant='contained' | ||
> | ||
<OpenModelControl fileOpen={fileOpen}/> | ||
<TooltipIconButton | ||
title='Search' | ||
icon={<SearchIcon className='icon-share' color='secondary'/>} | ||
placement='bottom' | ||
aboutInfo={false} | ||
selected={isSearchVisible} | ||
onClick={toggleIsSearchVisible} | ||
/> | ||
<TooltipIconButton | ||
title='Navigation' | ||
icon={<TreeIcon className='icon-share' color='secondary' style={{width: '17px', height: '17px'}}/>} | ||
placement='bottom' | ||
dataTestId='Navigation' | ||
aboutInfo={false} | ||
selected={isNavigationVisible} | ||
onClick={() => { | ||
if (isVersionHistoryVisible) { | ||
toggleIsVersionHistoryVisible() | ||
toggleIsNavigationVisible() | ||
} else { | ||
toggleIsNavigationVisible() | ||
} | ||
}} | ||
/> | ||
{repo !== undefined && | ||
<TooltipIconButton | ||
title='Project History' | ||
icon={<HistoryIcon className='icon-share' color='secondary'/>} | ||
placement='bottom' | ||
selected={isVersionHistoryVisible} | ||
onClick={() => { | ||
if (isNavigationVisible) { | ||
toggleIsVersionHistoryVisible() | ||
toggleIsNavigationVisible() | ||
} else { | ||
toggleIsVersionHistoryVisible() | ||
} | ||
}} | ||
/> | ||
} | ||
|
||
</ButtonGroup> | ||
) | ||
} |
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
Oops, something went wrong.