Skip to content

Commit

Permalink
Make inspection report dialog dismissable
Browse files Browse the repository at this point in the history
  • Loading branch information
Eddasol committed Jan 8, 2025
1 parent 7f837c2 commit f1d822c
Showing 1 changed file with 7 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -36,22 +36,26 @@ export const InspectionDialogView = ({ task, tasks }: InspectionDialogViewProps)
const { switchSelectedInspectionTask } = useInspectionsContext()
const { data } = FetchImageData(task)

const closeDialog = () => {
switchSelectedInspectionTask(undefined)
}

return (
<>
{data !== undefined && (
<StyledDialog open={true}>
<StyledDialog open={true} isDismissable onClose={closeDialog}>
<StyledDialogContent>
<StyledDialogHeader>
<Typography variant="accordion_header" group="ui">
{TranslateText('Inspection report')}
</Typography>
<StyledCloseButton variant="ghost" onClick={() => switchSelectedInspectionTask(undefined)}>
<StyledCloseButton variant="ghost" onClick={closeDialog}>
<Icon name={Icons.Clear} size={24} />
</StyledCloseButton>
</StyledDialogHeader>
<StyledDialogInspectionView>
<div>
{data !== undefined && <StyledInspection src={data} />}
<StyledInspection src={data} />
<StyledBottomContent>
<StyledInfoContent>
<Typography variant="caption">{TranslateText('Installation') + ':'}</Typography>
Expand Down

0 comments on commit f1d822c

Please sign in to comment.