Skip to content

Commit

Permalink
move operations group to horizontal
Browse files Browse the repository at this point in the history
  • Loading branch information
OlegMoshkovich committed Oct 17, 2023
1 parent 0e24458 commit 4bcacb9
Show file tree
Hide file tree
Showing 2 changed files with 70 additions and 59 deletions.
121 changes: 66 additions & 55 deletions src/Components/OperationsGroup.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import React, {useState} from 'react'
import Box from '@mui/material/Box'
import Stack from '@mui/material/Stack'
import ButtonGroup from '@mui/material/ButtonGroup'
import useTheme from '@mui/styles/useTheme'
// import useTheme from '@mui/styles/useTheme'
import useStore from '../store/useStore'
import {useIsMobile} from './Hooks'
// import AboutControl from './About/AboutControl'
Expand All @@ -16,9 +16,9 @@ import {useExistInFeature} from '../hooks/useExistInFeature'
import ChatOutlinedIcon from '@mui/icons-material/ChatOutlined'
import CenterFocusWeakIcon from '@mui/icons-material/CenterFocusWeak'
import FormatListBulletedOutlinedIcon from '@mui/icons-material/FormatListBulletedOutlined'
import NightlightOutlinedIcon from '@mui/icons-material/NightlightOutlined'
// import NightlightOutlinedIcon from '@mui/icons-material/NightlightOutlined'
import HighlightOffIcon from '@mui/icons-material/HighlightOff'
import WbSunnyOutlinedIcon from '@mui/icons-material/WbSunnyOutlined'
// import WbSunnyOutlinedIcon from '@mui/icons-material/WbSunnyOutlined'


/**
Expand Down Expand Up @@ -70,28 +70,19 @@ export default function OperationsGroup({deselectItems, viewer}) {
}
}

const theme = useTheme()
// const theme = useTheme()
return (
<Stack
spacing={2}
direction="column"
justifyContent="space-around"
alignItems="center"
alignItems="flex-end"
sx={{margin: '1em'}}
>
<ButtonGroup
orientation='vertical'
orientation='horizontal'
variant='contained'
>
{isLoginVisible &&
<AuthNav/>
}

{isCollaborationGroupVisible &&
<Box>
<ShareControl/>
</Box>
}

{isModelInteractionGroupVisible &&
<>
Expand All @@ -108,6 +99,16 @@ export default function OperationsGroup({deselectItems, viewer}) {
</>
}

{isCollaborationGroupVisible &&
<Box>
<ShareControl/>
</Box>
}
{isLoginVisible &&
<AuthNav/>
}


{isSettingsVisible &&
<>
{isAppStoreEnabled &&
Expand All @@ -118,62 +119,72 @@ export default function OperationsGroup({deselectItems, viewer}) {
onClick={() => toggleAppStoreDrawer()}
/>
}
<TooltipIconButton
{/* <TooltipIconButton
title={`${theme.palette.mode === 'light' ? 'Day' : 'Night'} theme`}
onClick={() => theme.toggleColorMode()}
icon={
theme.palette.mode === 'light' ?
<WbSunnyOutlinedIcon className='icon-share' color='secondary'/> :
<NightlightOutlinedIcon className='icon-share'/> }
/>
/> */}
{/* <AboutControl/> */}
</>
}
{/* Invisible */}
<CameraControl/>
</ButtonGroup >
{isSelected() &&
<ButtonGroup
orientation='vertical'
variant='contained'
>
{selectedElement !== null &&
<>
<TooltipIconButton
title='Properties'
onClick={() => {
turnOffTooltips()
toggle('Properties')
}}
selected={isPropertiesOn}
icon={<FormatListBulletedOutlinedIcon className='icon-share' color='secondary'/>}
/>
<Stack
spacing={2}
direction="column"
justifyContent="center"
alignItems="center"
sx={{
margin: '1em',
}}
>
{isSelected() &&
<ButtonGroup
orientation='vertical'
variant='contained'
>
{selectedElement !== null &&
<>
<TooltipIconButton
title='Properties'
onClick={() => {
turnOffTooltips()
toggle('Properties')
}}
selected={isPropertiesOn}
icon={<FormatListBulletedOutlinedIcon className='icon-share' color='secondary'/>}
/>
<TooltipIconButton
showTitle={true}
title='Isolate'
onClick={() => {
viewer.isolator.toggleIsolationMode()
setIsolate(!isolate)
}}
selected={isolate}
icon={<CenterFocusWeakIcon/>}
/>
</>
}
<TooltipIconButton
showTitle={true}
title='Isolate'
title='Clear'
onClick={() => {
viewer.isolator.toggleIsolationMode()
setIsolate(!isolate)
if (isolate) {
setIsolate(!isolate)
viewer.isolator.toggleIsolationMode()
}
deselectItems()
}}
selected={isolate}
icon={<CenterFocusWeakIcon/>}
selected={isSelected()}
icon={<HighlightOffIcon className='icon-share'color='secondary'/>}
/>
</>
}
<TooltipIconButton
title='Clear'
onClick={() => {
if (isolate) {
setIsolate(!isolate)
viewer.isolator.toggleIsolationMode()
}
deselectItems()
}}
selected={isSelected()}
icon={<HighlightOffIcon className='icon-share'color='secondary'/>}
/>
</ButtonGroup>
}
</ButtonGroup>
}
</Stack>
</Stack>
)
}
8 changes: 4 additions & 4 deletions src/theme/Components.js
Original file line number Diff line number Diff line change
Expand Up @@ -57,8 +57,8 @@ export function getComponentOverrides(palette, typography) {
MuiToggleButton: {
styleOverrides: {
sizeMedium: {
'width': '50px',
'height': '50px',
'width': '40px',
'height': '40px',
'border': 'none',
'&.Mui-selected, &.Mui-selected:hover': {
backgroundColor: palette.secondary.background,
Expand All @@ -67,8 +67,8 @@ export function getComponentOverrides(palette, typography) {
},
sizeSmall: {
border: 'none',
width: '40px',
height: '40px',
width: '24px',
height: '24px',
},
},
},
Expand Down

0 comments on commit 4bcacb9

Please sign in to comment.