Skip to content

Commit

Permalink
fix: [M3-7072] - Long drawer titles overlapping close icon (#9731)
Browse files Browse the repository at this point in the history
* Fix overlap caused by positioning

* Fix eslint perfectionist warnings

* Fix typo

* Added changeset: Long drawer titles overlapping close icon

* Use title padding with absolute positioning

* Uncomment unintentionally committed commented lines

* Use margin, which makes more sense
  • Loading branch information
mjac0bs authored Oct 4, 2023
1 parent a27d3d6 commit abe4600
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 13 deletions.
5 changes: 5 additions & 0 deletions packages/manager/.changeset/pr-9731-fixed-1695931370886.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@linode/manager": Fixed
---

Long drawer titles overlapping close icon ([#9731](https://github.com/linode/manager/pull/9731))
27 changes: 14 additions & 13 deletions packages/manager/src/components/Drawer.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ interface Props extends DrawerProps {
*/
title: string;
/**
* Increaces the Drawers width from 480px to 700px on desktop-sized viewports
* Increases the Drawers width from 480px to 700px on desktop-sized viewports
* @default false
*/
wide?: boolean;
Expand All @@ -34,11 +34,6 @@ const useStyles = makeStyles()((theme: Theme) => ({
minWidth: 'auto',
padding: 0,
},
drawerHeader: {
'&&': {
marginBottom: theme.spacing(2),
},
},
common: {
'& .actionPanel': {
display: 'flex',
Expand All @@ -55,13 +50,19 @@ const useStyles = makeStyles()((theme: Theme) => ({
},
},
default: {
width: 480,
[theme.breakpoints.down('sm')]: {
maxWidth: 445,
width: '100%',
},
width: 480,
},
drawerHeader: {
'&&': {
marginBottom: theme.spacing(2),
},
},
title: {
marginRight: theme.spacing(4),
wordBreak: 'break-word',
},
wide: {
Expand Down Expand Up @@ -90,18 +91,18 @@ export const Drawer = (props: Props) => {

return (
<_Drawer
onClose={(event, reason) => {
if (onClose && reason !== 'backdropClick') {
onClose(event, reason);
}
}}
anchor="right"
classes={{
paper: cx(classes.common, {
[classes.default]: !wide,
[classes.wide]: wide,
}),
}}
onClose={(event, reason) => {
if (onClose && reason !== 'backdropClick') {
onClose(event, reason);
}
}}
anchor="right"
{...rest}
aria-labelledby={titleID}
data-qa-drawer
Expand Down

0 comments on commit abe4600

Please sign in to comment.