Skip to content

Commit 76a0649

Browse files
committed
Update color pallete and toggle button component
1 parent ac83511 commit 76a0649

File tree

2 files changed

+13
-35
lines changed

2 files changed

+13
-35
lines changed

Diff for: src/theme/index.tsx

+12-34
Original file line numberDiff line numberDiff line change
@@ -121,15 +121,9 @@ const components: Components = {
121121
styleOverrides: {
122122
groupedContainedPrimary: ({ theme }: { theme: any }) => ({
123123
color: theme.palette.primary.main,
124-
backgroundColor: alpha(
125-
theme.palette.primary.main,
126-
theme.palette.action.hoverOpacity
127-
),
124+
backgroundColor: alpha(theme.palette.primary.main, theme.palette.action.hoverOpacity),
128125
"&:hover": {
129-
backgroundColor: alpha(
130-
theme.palette.primary.main,
131-
theme.palette.action.selectedOpacity
132-
),
126+
backgroundColor: alpha(theme.palette.primary.main, theme.palette.action.selectedOpacity),
133127
},
134128
}),
135129
},
@@ -566,16 +560,10 @@ const components: Components = {
566560
borderRadius: 4,
567561
width: "unset",
568562
"&.Mui-focused:hover": {
569-
background: alpha(
570-
theme.palette.primary.main,
571-
theme.palette.action.selectedOpacity
572-
),
563+
background: alpha(theme.palette.primary.main, theme.palette.action.selectedOpacity),
573564
},
574565
"&.Mui-selected, &.Mui-selected:hover, &.Mui-selected.Mui-focused": {
575-
background: alpha(
576-
theme.palette.primary.main,
577-
theme.palette.action.selectedOpacity
578-
),
566+
background: alpha(theme.palette.primary.main, theme.palette.action.selectedOpacity),
579567
" .MuiTreeItem-label .MuiSvgIcon-root": {
580568
color: theme.palette.primary.main,
581569
},
@@ -603,16 +591,11 @@ const components: Components = {
603591
width: "8px",
604592
height: "8px",
605593
},
606-
"&::-webkit-scrollbar-track-piece, & *::-webkit-scrollbar-track-piece":
607-
({ theme }: { theme: any }) => ({
594+
"&::-webkit-scrollbar-track-piece, & *::-webkit-scrollbar-track-piece": ({ theme }: { theme: any }) => ({
608595
backgroundColor: theme.palette.grey[100],
609596
borderRadius: "4px",
610597
}),
611-
"&::-webkit-scrollbar-thumb, & *::-webkit-scrollbar-thumb": ({
612-
theme,
613-
}: {
614-
theme: any;
615-
}) => ({
598+
"&::-webkit-scrollbar-thumb, & *::-webkit-scrollbar-thumb": ({ theme }: { theme: any }) => ({
616599
backgroundColor: theme.palette.grey[300],
617600
borderRadius: "4px",
618601
}),
@@ -631,10 +614,7 @@ const components: Components = {
631614
root: ({ theme }: { theme: any }) => ({
632615
color: theme.palette.text.secondary,
633616
"&.Mui-selected": {
634-
backgroundColor: alpha(
635-
theme.palette.primary.main,
636-
theme.palette.action.selectedOpacity
637-
),
617+
backgroundColor: alpha(theme.palette.primary.main, theme.palette.action.selectedOpacity),
638618
color: theme.palette.primary.main,
639619
svg: {
640620
color: theme.palette.primary.main,
@@ -676,8 +656,7 @@ const components: Components = {
676656
width: "8px",
677657
height: "8px",
678658
},
679-
"&::-webkit-scrollbar-track-piece, & *::-webkit-scrollbar-track-piece":
680-
{
659+
"&::-webkit-scrollbar-track-piece, & *::-webkit-scrollbar-track-piece": {
681660
backgroundColor: theme.palette.grey[800],
682661
borderRadius: "4px",
683662
},
@@ -689,11 +668,11 @@ const components: Components = {
689668
},
690669
},
691670
MuiToggleButton: {
692-
styleOverrides: {
671+
styleOverrides: ({ theme }: { theme: any }) => ({
693672
sizeSmall: {
694-
fontSize: "16px",
673+
...theme.typography.body2,
695674
},
696-
},
675+
}),
697676
},
698677
MuiListItemText: {
699678
styleOverrides: {
@@ -749,8 +728,7 @@ const components: Components = {
749728
},
750729
styleOverrides: {
751730
select: ({ theme }: { theme: any }) => ({
752-
"&.MuiSelect-outlined.MuiInputBase-input.MuiOutlinedInput-input:read-only":
753-
{
731+
"&.MuiSelect-outlined.MuiInputBase-input.MuiOutlinedInput-input:read-only": {
754732
color: theme.palette.text.primary,
755733
},
756734
}),

Diff for: src/theme/palette.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -194,4 +194,4 @@ const darkThemePalette = {
194194
},
195195
};
196196

197-
export { lightThemePalette, darkThemePalette };
197+
export { lightThemePalette, darkThemePalette };

0 commit comments

Comments
 (0)