Skip to content

Commit aff1871

Browse files
committed
aks-desktop: ReviewStep: Use sx instead of styled
1 parent d78fc2f commit aff1871

File tree

1 file changed

+13
-27
lines changed
  • plugins/aks-desktop/src/components/CreateAKSProject/components

1 file changed

+13
-27
lines changed

plugins/aks-desktop/src/components/CreateAKSProject/components/ReviewStep.tsx

Lines changed: 13 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -2,50 +2,35 @@
22
// Licensed under the Apache 2.0.
33

44
import { Icon } from '@iconify/react';
5-
import { styled } from '@mui/material';
65
import { Box, Card, Grid, Typography } from '@mui/material';
76
import React from 'react';
87
import { ReviewStepProps } from '../types';
98
import { formatCpuValue, formatMemoryValue } from '../validators';
109

11-
const PREFIX = 'ReviewStep';
12-
13-
const classes = {
14-
sectionTitle: `${PREFIX}-sectionTitle`,
15-
sectionDescription: `${PREFIX}-sectionDescription`,
16-
};
17-
18-
const StyledBox = styled(Box)(({ theme }) => ({
19-
[`& .${classes.sectionTitle}`]: {
20-
color: theme.palette.text.primary,
21-
},
22-
23-
[`& .${classes.sectionDescription}`]: {
24-
marginBottom: theme.spacing(2),
25-
color: theme.palette.text.secondary,
26-
},
27-
}));
28-
2910
/**
3011
* Review step component for displaying configuration summary
3112
*/
3213
export const ReviewStep: React.FC<ReviewStepProps> = ({ formData, subscriptions, clusters }) => {
3314
const selectedSubscription = subscriptions.find(sub => sub.id === formData.subscription);
3415
const selectedCluster = clusters.find(c => c.name === formData.cluster);
3516

17+
const sectionTitleSx = { color: 'text.primary' };
18+
const sectionDescriptionSx = { mb: 2, color: 'text.secondary' };
19+
3620
return (
37-
<StyledBox>
38-
<Typography variant="h5" component="h2" gutterBottom className={classes.sectionTitle}>
21+
<Box>
22+
<Typography variant="h5" component="h2" gutterBottom sx={sectionTitleSx}>
3923
Review Project Configuration
4024
</Typography>
41-
<Typography variant="body2" className={classes.sectionDescription}>
25+
<Typography variant="body2" sx={sectionDescriptionSx}>
4226
Please review all the settings before creating your AKS project
4327
</Typography>
28+
4429
<Grid container spacing={3}>
4530
{/* Basics Section */}
4631
<Grid item xs={12}>
4732
<Card variant="outlined" sx={{ p: 2, mb: 2 }}>
48-
<Typography variant="h6" gutterBottom className={classes.sectionTitle}>
33+
<Typography variant="h6" gutterBottom sx={sectionTitleSx}>
4934
<Icon icon="mdi:project" style={{ marginRight: 8, verticalAlign: 'middle' }} />
5035
Project Basics
5136
</Typography>
@@ -87,7 +72,7 @@ export const ReviewStep: React.FC<ReviewStepProps> = ({ formData, subscriptions,
8772
{/* Networking and Compute Quota Side by Side */}
8873
<Grid item xs={12} md={6}>
8974
<Card variant="outlined" sx={{ p: 2, mb: 2, height: '200px' }}>
90-
<Typography variant="h6" gutterBottom className={classes.sectionTitle}>
75+
<Typography variant="h6" gutterBottom sx={sectionTitleSx}>
9176
<Icon icon="mdi:network" style={{ marginRight: 8, verticalAlign: 'middle' }} />
9277
Networking Policies
9378
</Typography>
@@ -110,7 +95,7 @@ export const ReviewStep: React.FC<ReviewStepProps> = ({ formData, subscriptions,
11095

11196
<Grid item xs={12} md={6}>
11297
<Card variant="outlined" sx={{ p: 2, mb: 2, height: '200px' }}>
113-
<Typography variant="h6" gutterBottom className={classes.sectionTitle}>
98+
<Typography variant="h6" gutterBottom sx={sectionTitleSx}>
11499
<Icon icon="mdi:cpu-64-bit" style={{ marginRight: 8, verticalAlign: 'middle' }} />
115100
Compute Quota
116101
</Typography>
@@ -143,6 +128,7 @@ export const ReviewStep: React.FC<ReviewStepProps> = ({ formData, subscriptions,
143128
<Typography variant="body1">{formatCpuValue(formData.cpuLimit)}</Typography>
144129
</Box>
145130
</Grid>
131+
146132
{/* Memory Section */}
147133
<Grid item xs={12} md={6}>
148134
<Box
@@ -180,7 +166,7 @@ export const ReviewStep: React.FC<ReviewStepProps> = ({ formData, subscriptions,
180166
{/* Access Section with Scroll */}
181167
<Grid item xs={12}>
182168
<Card variant="outlined" sx={{ p: 2, mb: 2 }}>
183-
<Typography variant="h6" gutterBottom className={classes.sectionTitle}>
169+
<Typography variant="h6" gutterBottom sx={sectionTitleSx}>
184170
<Icon icon="mdi:account-group" style={{ marginRight: 8, verticalAlign: 'middle' }} />
185171
Access Control ({formData.userAssignments.length} assignee
186172
{formData.userAssignments.length !== 1 ? 's' : ''})
@@ -221,7 +207,7 @@ export const ReviewStep: React.FC<ReviewStepProps> = ({ formData, subscriptions,
221207
</Card>
222208
</Grid>
223209
</Grid>
224-
</StyledBox>
210+
</Box>
225211
);
226212
};
227213

0 commit comments

Comments
 (0)