-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Feat(submodels):show submodel ID in viewer (#85)
* feat(submodel-id): show id in tooltip and open dialog on click --------- Co-authored-by: Nils Rothamel <[email protected]>
- Loading branch information
1 parent
93a2fbc
commit 25acc5a
Showing
6 changed files
with
113 additions
and
15 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
48 changes: 48 additions & 0 deletions
48
src/app/[locale]/viewer/_components/submodel/SubmodelInfoDialog.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,48 @@ | ||
import { Box, Dialog, DialogContent, IconButton, Typography } from '@mui/material'; | ||
import CloseIcon from '@mui/icons-material/Close'; | ||
import { useTranslations } from 'next-intl'; | ||
|
||
type SubmodelInfoDialogProps = { | ||
readonly onClose: () => void; | ||
readonly open: boolean; | ||
readonly idShort: string | null | undefined ; | ||
readonly id: string | undefined; | ||
}; | ||
|
||
export function SubmodelInfoDialog(props: SubmodelInfoDialogProps) { | ||
const t = useTranslations('submodels'); | ||
|
||
return ( | ||
<Dialog | ||
open={props.open} | ||
onClose={props.onClose} | ||
maxWidth="md" | ||
fullWidth={true} | ||
> | ||
<IconButton | ||
aria-label="close" | ||
onClick={props.onClose} | ||
sx={{ | ||
position: 'absolute', | ||
right: 8, | ||
top: 8, | ||
color: (theme) => theme.palette.grey[500], | ||
}} | ||
> | ||
<CloseIcon /> | ||
</IconButton> | ||
<DialogContent style={{ padding: '40px'}}> | ||
<Box display="flex" flexDirection="column" gap="20px"> | ||
<Typography variant="h2" color={'primary'}> | ||
{props.idShort} | ||
</Typography> | ||
<Box> | ||
<Typography color="text.secondary"> | ||
{t('idLabel')} {props.id} | ||
</Typography> | ||
</Box> | ||
</Box> | ||
</DialogContent> | ||
</Dialog> | ||
); | ||
} |
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