Skip to content

Commit 46caf4b

Browse files
Merge branch 'master' into datatable/theme
2 parents 2eb0eb9 + 63e0b80 commit 46caf4b

File tree

4 files changed

+21
-32
lines changed

4 files changed

+21
-32
lines changed

src/custom/Stepper/index.tsx

Lines changed: 16 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,9 @@
1-
import { Box, IconProps, Stack, Step, StepConnector, StepLabel, Stepper } from '@mui/material';
1+
import { Box, Stack, Step, StepConnector, StepLabel, Stepper, useTheme } from '@mui/material';
22
import { stepConnectorClasses } from '@mui/material/StepConnector';
33
import { StepIconProps } from '@mui/material/StepIcon';
44
import { styled } from '@mui/system';
55
import React, { useMemo, useState } from 'react';
6+
import { IconProps } from '../../icons/types';
67

78
interface ColorlibStepIconPropsI extends StepIconProps {
89
icons: React.ComponentType<IconProps>[];
@@ -23,6 +24,7 @@ interface CustomizedStepperPropsI {
2324
stepLabels: string[];
2425
children: React.ReactNode;
2526
icons: React.ComponentType<IconProps>[];
27+
ContentWrapper?: React.ComponentType;
2628
}
2729

2830
interface UseStepperI {
@@ -100,9 +102,10 @@ function ColorlibStepIcon(props: ColorlibStepIconPropsI) {
100102
const { active, completed, className, icons } = props;
101103

102104
const Icon = icons[Number(props.icon) - 1];
105+
const theme = useTheme();
103106
return (
104107
<ColorlibStepIconRoot ownerState={{ completed, active }} className={className}>
105-
{Icon ? <Icon /> : null}
108+
{Icon ? <Icon fill={theme.palette.icon.secondary} /> : null}
106109
</ColorlibStepIconRoot>
107110
);
108111
}
@@ -111,11 +114,18 @@ const CustomizedStepper: React.FC<CustomizedStepperPropsI> = ({
111114
stepLabels,
112115
activeStep,
113116
children,
114-
icons
117+
icons,
118+
ContentWrapper = StepContentWrapper
115119
}) => {
120+
const theme = useTheme();
121+
116122
return (
117-
<Stack spacing={2}>
118-
<Stack direction="row" justifyContent="center">
123+
<Stack>
124+
<Stack
125+
direction="row"
126+
justifyContent="center"
127+
style={{ paddingBlock: '1rem', backgroundColor: theme.palette.background.blur?.heavy }}
128+
>
119129
<Stepper alternativeLabel activeStep={activeStep} connector={<ColorlibConnector />}>
120130
{stepLabels.map((label) => (
121131
<Step key={label}>
@@ -128,7 +138,7 @@ const CustomizedStepper: React.FC<CustomizedStepperPropsI> = ({
128138
))}
129139
</Stepper>
130140
</Stack>
131-
<StepContentWrapper>{children}</StepContentWrapper>
141+
<ContentWrapper>{children}</ContentWrapper>
132142
</Stack>
133143
);
134144
};

src/icons/Add/AddIcon.tsx

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,7 @@ export const AddIcon = ({
1616
data-testid="add-icon-svg"
1717
{...props}
1818
>
19-
<path d="M0 0h24v24H0z" fill={fill} />
20-
<path d="M19 13h-6v6h-2v-6H5v-2h6V5h2v6h6v2z" />
19+
<path d="M19 13h-6v6h-2v-6H5v-2h6V5h2v6h6v2z" fill={fill} />
2120
</svg>
2221
);
2322
};

src/theme/index.tsx

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
import { styled, useTheme } from '@mui/material';
2+
13
export { darkModePalette, lightModePalette } from './palette';
24
export { typography } from './typography';
35

@@ -6,3 +8,5 @@ export {
68
SistentThemeProviderWithoutBaseLine
79
} from './ThemeProvider';
810
export * from './colors';
11+
12+
export { styled, useTheme };

src/theme/theme.ts

Lines changed: 0 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -16,27 +16,3 @@ export const createCustomTheme = (mode: PaletteMode) => {
1616
breakpoints: {}
1717
});
1818
};
19-
20-
/*
21-
const commonPalette = {
22-
palette: {
23-
paletteType,
24-
...(paletteType === 'light' ? lightModePalette : darkModePalette)
25-
}
26-
};
27-
28-
29-
const palette =
30-
paletteType === 'dark'
31-
? {
32-
mode: 'dark',
33-
...commonPalette,
34-
text: {
35-
main: '#FFFFFF'
36-
}
37-
}
38-
: {
39-
mode: 'light',
40-
...commonPalette
41-
};
42-
*/

0 commit comments

Comments
 (0)