Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: Billing Contact UI Regression from by MUI Update #9667

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions packages/manager/.changeset/pr-9667-fixed-1694576063628.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@linode/manager": Fixed
---

Billing Contact UI Regression caused by MUI Update ([#9667](https://github.com/linode/manager/pull/9667))
Copy link
Contributor

@cpathipa cpathipa Sep 13, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Adding m={0} at line 133 would also solves the issue and consistent with other boxes without having additional padding to subelements.
Also, you can completely lift sxGrid styles.

image

image

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We could do that, but do we really want to override MUI's Grid rules? Also, lifting lift sxGrid/sxBox styles still breaks some UI

Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import { Box } from 'src/components/Box';
import Grid from '@mui/material/Unstable_Grid2';
import { styled } from '@mui/material/styles';
import countryData from 'country-region-data';
Expand Down Expand Up @@ -104,7 +103,7 @@ const ContactInformation = (props: Props) => {
(_country) => _country.countryShortCode === country
)?.countryName;

const sxBox = {
const sxGrid = {
flex: 1,
maxWidth: '100%',
position: 'relative',
Expand Down Expand Up @@ -140,7 +139,7 @@ const ContactInformation = (props: Props) => {
state ||
zip ||
country) && (
<Box sx={sxBox}>
<Grid sx={sxGrid}>
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Now that's it's a Grid I don't think you need the extra CSS here. You can most likely remove sxGrid sx all together

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sadly, that did not work 😖

{(firstName || lastName) && (
<StyledTypography
data-qa-contact-name
Expand Down Expand Up @@ -170,10 +169,9 @@ const ContactInformation = (props: Props) => {
{city && state && ','} {state} {zip}
</StyledTypography>
<StyledTypography>{countryName}</StyledTypography>
</Box>
</Grid>
)}

<Box sx={sxBox}>
<Grid sx={sxGrid}>
<StyledTypography
data-qa-contact-email
sx={{ wordBreak: 'break-all' }}
Expand All @@ -188,7 +186,7 @@ const ContactInformation = (props: Props) => {
<strong>Tax ID</strong> {taxId}
</StyledTypography>
)}
</Box>
</Grid>
</Grid>
</BillingPaper>
<BillingContactDrawer
Expand Down