Skip to content

Commit 62b4fe0

Browse files
fix: [M3-10351] - Align Encrypt Volume checkbox in Volume Create with other fields (#12592)
* Adjust checkbox alignment in Volume create * Added changeset: Align Encrypt Volume checkbox in Volume Create with other fields * Added changeset: Added new prop `sxCheckbox` to overried default styles for Checkbox * PR feedback - @bnussman-akamai @coliu-akamai * Delete pr-12592-changed-1753738347547.md * Update packages/manager/.changeset/pr-12592-fixed-1753738232161.md Co-authored-by: Connie Liu <[email protected]> * PR feedback - @coliu-akamai - rename sx prop to sxCheckbox --------- Co-authored-by: Connie Liu <[email protected]>
1 parent eba5807 commit 62b4fe0

File tree

6 files changed

+15
-0
lines changed

6 files changed

+15
-0
lines changed
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+
Left alignment of Encryption checkbox in Linode Create, Linode Rebuild, and Volume Create forms ([#12592](https://github.com/linode/manager/pull/12592))

packages/manager/src/components/Encryption/Encryption.tsx

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,8 @@ import type { JSX } from 'react';
55

66
import { checkboxTestId, descriptionTestId, headerTestId } from './constants';
77

8+
import type { SxProps, Theme } from '@mui/material/styles';
9+
810
export interface EncryptionProps {
911
descriptionCopy: JSX.Element | string;
1012
disabled?: boolean;
@@ -14,6 +16,7 @@ export interface EncryptionProps {
1416
isEncryptEntityChecked: boolean;
1517
notices?: string[];
1618
onChange: (checked: boolean) => void;
19+
sxCheckbox?: SxProps<Theme>;
1720
}
1821

1922
export const Encryption = (props: EncryptionProps) => {
@@ -26,6 +29,7 @@ export const Encryption = (props: EncryptionProps) => {
2629
isEncryptEntityChecked,
2730
notices,
2831
onChange,
32+
sxCheckbox,
2933
} = props;
3034

3135
return (
@@ -57,6 +61,8 @@ export const Encryption = (props: EncryptionProps) => {
5761
data-testid={checkboxTestId}
5862
disabled={disabled}
5963
onChange={(e, checked) => onChange(checked)}
64+
sx={sxCheckbox}
65+
sxFormLabel={{ marginLeft: '0px' }}
6066
text={`Encrypt ${entityType ?? 'Disk'}`}
6167
toolTipText={disabled ? disabledReason : ''}
6268
/>

packages/manager/src/features/Linodes/LinodeCreate/Security.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -117,6 +117,7 @@ export const Security = () => {
117117
onChange={(checked) =>
118118
field.onChange(checked ? 'enabled' : 'disabled')
119119
}
120+
sxCheckbox={{ paddingLeft: '0px' }}
120121
/>
121122
)}
122123
/>

packages/manager/src/features/Linodes/LinodesDetail/LinodeRebuild/DiskEncryption.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,7 @@ export const DiskEncryption = (props: Props) => {
6363
onChange={(checked) =>
6464
field.onChange(checked ? 'enabled' : 'disabled')
6565
}
66+
sxCheckbox={{ paddingLeft: '0px' }}
6667
/>
6768
)}
6869
/>

packages/manager/src/features/Volumes/Drawers/VolumeDrawer/LinodeVolumeCreateForm.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -286,6 +286,7 @@ export const LinodeVolumeCreateForm = (props: Props) => {
286286
: []
287287
}
288288
onChange={() => toggleVolumeEncryptionEnabled(values.encryption)}
289+
sxCheckbox={{ paddingLeft: '0px' }}
289290
/>
290291
</Box>
291292
)}

packages/manager/src/features/Volumes/VolumeCreate.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -550,6 +550,7 @@ export const VolumeCreate = () => {
550550
onChange={() =>
551551
toggleVolumeEncryptionEnabled(values.encryption)
552552
}
553+
sxCheckbox={{ paddingLeft: '0px' }}
553554
/>
554555
</Box>
555556
)}

0 commit comments

Comments
 (0)