Skip to content

Commit 27a229b

Browse files
committed
fix: no LoadingButton
1 parent cb4edeb commit 27a229b

2 files changed

Lines changed: 19 additions & 36 deletions

File tree

src/components/LoadingButton/index.tsx

Lines changed: 18 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,28 @@
11
import { makeStyles } from "tss-react/mui"
22

33
import { Button, CircularProgress, Stack } from "@mui/material"
4+
import { lighten } from "@mui/material/styles"
45

56
const useStyles = makeStyles()(theme => ({
67
loadingIndicator: {
78
color: theme.vars.palette.primary.contrastText,
89
width: "max-content",
910
},
11+
root: {
12+
width: "15rem",
13+
height: "4.4rem",
14+
fontSize: "1.6rem",
15+
fontWeight: 600,
16+
borderRadius: "0.5rem",
17+
},
18+
containedPrimary: {
19+
"&:hover": {
20+
backgroundColor: lighten("#FF684B", 0.1),
21+
},
22+
},
23+
loading: {
24+
backgroundColor: lighten("#FF684B", 0.1) + " !important",
25+
},
1026
}))
1127

1228
const ScrollLoadingButton = props => {
@@ -25,7 +41,8 @@ const ScrollLoadingButton = props => {
2541

2642
return (
2743
<Button
28-
classes={{ loadingIndicator: classes.loadingIndicator }}
44+
variant="contained"
45+
classes={{ root: classes.root, loading: classes.loading, loadingIndicator: classes.loadingIndicator }}
2946
loadingIndicator={
3047
<Stack direction="row" alignItems="center" spacing={1}>
3148
<span>{renderLoadingText()}</span>

src/theme/light.tsx

Lines changed: 1 addition & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,4 @@
1-
import { color } from "motion/react"
2-
3-
import { alpha, lighten } from "@mui/material/styles"
1+
import { alpha } from "@mui/material/styles"
42

53
import { boxShadowOptions, paletteOptions, typographyOptions } from "./options"
64

@@ -166,38 +164,6 @@ const lightTheme = {
166164
},
167165
],
168166
},
169-
MuiLoadingButton: {
170-
styleOverrides: {
171-
root: {
172-
width: "15rem",
173-
height: "4.4rem",
174-
fontSize: "1.6rem",
175-
fontWeight: 600,
176-
borderRadius: "0.5rem",
177-
},
178-
},
179-
defaultProps: {
180-
variant: "contained",
181-
color: "primary",
182-
},
183-
variants: [
184-
{
185-
props: { variant: "contained", color: "primary" },
186-
style: {
187-
backgroundColor: paletteOptions.primary.main,
188-
"&:hover": {
189-
backgroundColor: lighten(paletteOptions.primary.main, 0.1),
190-
},
191-
},
192-
},
193-
{
194-
props: { variant: "contained", color: "primary", loading: true },
195-
style: {
196-
backgroundColor: `${paletteOptions.primary.main} !important`,
197-
},
198-
},
199-
],
200-
},
201167
MuiMenuItem: {
202168
styleOverrides: {
203169
root: {

0 commit comments

Comments
 (0)