-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
add missing viewer icons + add tooltips + 3D viewer settings popover
- Loading branch information
1 parent
61f3e89
commit caf0e2f
Showing
3 changed files
with
202 additions
and
30 deletions.
There are no files selected for viewing
57 changes: 57 additions & 0 deletions
57
applications/visualizer/frontend/src/components/viewers/ThreeD/CustomFormControlLabel.tsx
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,57 @@ | ||
import { FormControlLabel, Tooltip, Box, Stack, Typography } from '@mui/material'; | ||
import CustomSwitch from "../../ViewerContainer/CustomSwitch.tsx"; | ||
import HelpOutlineIcon from '@mui/icons-material/HelpOutline'; | ||
import {vars} from "../../../theme/variables.ts"; // Adjust the import path as needed | ||
|
||
const {gray50, gray600, gray400B} = vars | ||
const CustomFormControlLabel = ({ label, tooltipTitle, helpText }) => { | ||
return ( | ||
<FormControlLabel | ||
control={<Tooltip title={helpText}><CustomSwitch /></Tooltip>} | ||
sx={{ | ||
width: '100%', | ||
p: '.5rem .5rem .5rem .5rem', | ||
margin: 0, | ||
alignItems: "baseline", | ||
'&:hover': { | ||
background: gray50, | ||
borderRadius: '.5rem', | ||
}, | ||
"& .MuiFormControlLabel-label": { | ||
width: "100%", | ||
}, | ||
"& .MuiIconButton-root": { | ||
borderRadius: '.25rem', | ||
} | ||
}} | ||
label={ | ||
<Box> | ||
<Stack | ||
direction="row" | ||
alignItems="center" | ||
width={1} | ||
spacing=".5rem" | ||
justifyContent='space-between' | ||
> | ||
<Typography color={gray600} variant="subtitle1"> | ||
{label} | ||
</Typography> | ||
<Tooltip title={tooltipTitle}> | ||
<HelpOutlineIcon | ||
sx={{ | ||
color: gray400B, | ||
fontSize: "1rem", | ||
width: "1rem", | ||
height: "1rem", | ||
}} | ||
/> | ||
</Tooltip> | ||
</Stack> | ||
</Box> | ||
} | ||
value={undefined} | ||
/> | ||
); | ||
}; | ||
|
||
export default CustomFormControlLabel; |
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