Skip to content

Commit 05e6f03

Browse files
fix: [M3-9831] - Broken Payment Method Default Chip in the Make a Payment Drawer (#12101)
* fix default chip by removing unnessesary grid * Added changeset: Broken Payment Method Default Chip in the Make a Payment Drawer * remove default export * remove extra styles --------- Co-authored-by: Banks Nussman <banks@nussman.us>
1 parent e00ad6c commit 05e6f03

2 files changed

Lines changed: 30 additions & 51 deletions

File tree

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"@linode/manager": Fixed
3+
---
4+
5+
Broken Payment Method Default Chip in the Make a Payment Drawer ([#12101](https://github.com/linode/manager/pull/12101))

packages/manager/src/features/Billing/BillingPanels/BillingSummary/PaymentDrawer/PaymentMethodCard.tsx

Lines changed: 25 additions & 51 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
import { Chip } from '@linode/ui';
22
import { useTheme } from '@mui/material/styles';
3-
import Grid from '@mui/material/Grid2';
43
import * as React from 'react';
54

65
import {
@@ -83,56 +82,31 @@ export const PaymentMethodCard = (props: Props) => {
8382
return <Icon />;
8483
};
8584

86-
const sxVariant = {
87-
flexShrink: 0,
88-
paddingLeft: { sm: 1, xs: 0 },
89-
};
90-
91-
const renderVariant = () => {
92-
return is_default ? (
93-
<Grid
94-
sx={sxVariant}
95-
size={{
96-
md: 2,
97-
xs: 3,
98-
}}
99-
>
100-
<Chip component="span" label="DEFAULT" size="small" />
101-
</Grid>
102-
) : null;
103-
};
104-
10585
return (
106-
<Grid size={12}>
107-
<SelectionCard
108-
sxCardBase={{
109-
flexWrap: 'nowrap',
110-
}}
111-
sxCardBaseHeading={{
112-
flex: 'inherit',
113-
}}
114-
sxCardBaseIcon={{
115-
justifyContent: 'center',
116-
padding: 0,
117-
width: 45,
118-
}}
119-
sxCardBaseSubheading={{
120-
color: cardIsExpired ? theme.color.red : undefined,
121-
}}
122-
sxGrid={{
123-
minWidth: '100%',
124-
padding: 0,
125-
}}
126-
checked={id === paymentMethodId}
127-
disabled={disabled}
128-
heading={heading}
129-
onClick={() => handlePaymentMethodChange(id, cardIsExpired)}
130-
renderIcon={renderIcon}
131-
renderVariant={renderVariant}
132-
subheadings={[subHeading]}
133-
/>
134-
</Grid>
86+
<SelectionCard
87+
checked={id === paymentMethodId}
88+
disabled={disabled}
89+
heading={heading}
90+
onClick={() => handlePaymentMethodChange(id, cardIsExpired)}
91+
renderIcon={renderIcon}
92+
renderVariant={
93+
is_default ? () => <Chip label="DEFAULT" size="small" /> : undefined
94+
}
95+
subheadings={[subHeading]}
96+
sxCardBase={{
97+
flexWrap: 'nowrap',
98+
}}
99+
sxCardBaseHeading={{
100+
flex: 'inherit',
101+
}}
102+
sxCardBaseIcon={{
103+
justifyContent: 'center',
104+
padding: 0,
105+
width: 45,
106+
}}
107+
sxCardBaseSubheading={{
108+
color: cardIsExpired ? theme.color.red : undefined,
109+
}}
110+
/>
135111
);
136112
};
137-
138-
export default PaymentMethodCard;

0 commit comments

Comments
 (0)