Skip to content

Commit

Permalink
fix(interpret): fix icon position to stay always in the same place
Browse files Browse the repository at this point in the history
  • Loading branch information
char0n committed Feb 2, 2021
1 parent 84025b1 commit e814b87
Showing 1 changed file with 29 additions and 20 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,10 @@ import ApiDOMInterpreterDialog from 'features/app/right-pane/apidom/apidom-inter
const useStyles = makeStyles((theme) => ({
root: {
fontSize: '1rem',
position: 'relative',
},
launchButton: {
launchButtonTooltip: {
position: 'absolute',
right: theme.spacing(0.5),
right: theme.spacing(-1),
bottom: theme.spacing(0),
},
}));
Expand All @@ -35,31 +34,41 @@ const ApiDOM = ({ apiDOM }) => {

return (
<Box
flexGrow="1"
flexDirection="column"
className={classes.root}
borderColor="grey.400"
p={1.5}
pt={2}
pb={0}
borderRadius="borderRadius"
border={1}
height="100%"
whiteSpace="pre"
overflow="auto"
display="flex"
overflow="hidden"
>
<Box height="100%" dangerouslySetInnerHTML={{ __html: apiDOM }} />
<Tooltip title="Interpret ApiDOM">
<IconButton
aria-label="Interpret ApiDOM"
size="small"
className={classes.launchButton}
onClick={handleInterpreterDialogOpen}
>
<LaunchIcon />
</IconButton>
</Tooltip>
<ApiDOMInterpreterDialog
onClose={handleInterpreterDialogClose}
open={openInterpreterDialog}
<Box
flexDirection="column"
flexGrow="1"
overflow="auto"
whiteSpace="pre"
dangerouslySetInnerHTML={{ __html: apiDOM }}
/>
<Box minHeight={28} position="relative">
<Tooltip title="Interpret ApiDOM">
<IconButton
aria-label="Interpret ApiDOM"
size="small"
className={classes.launchButtonTooltip}
onClick={handleInterpreterDialogOpen}
>
<LaunchIcon />
</IconButton>
</Tooltip>
<ApiDOMInterpreterDialog
onClose={handleInterpreterDialogClose}
open={openInterpreterDialog}
/>
</Box>
</Box>
);
};
Expand Down

0 comments on commit e814b87

Please sign in to comment.