Skip to content

Commit

Permalink
fix: improve dark theme support
Browse files Browse the repository at this point in the history
  • Loading branch information
chybisov committed May 26, 2022
1 parent 7d36597 commit fea0977
Show file tree
Hide file tree
Showing 5 changed files with 16 additions and 11 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -65,9 +65,13 @@ export const ProgressToNextUpdate: React.FC<
variant={isLoading ? 'indeterminate' : 'determinate'}
size={24}
value={value}
sx={{
sx={(theme) => ({
opacity: value === 100 && !isLoading ? 0.5 : 1,
}}
color:
theme.palette.mode === 'light'
? theme.palette.primary.main
: theme.palette.primary.light,
})}
/>
</Box>
);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,4 @@ export const StepContent = styled(MuiStepContent)(({ theme }) => ({
export const StepAvatar = styled(Avatar)(({ theme, variant }) => ({
color:
variant === 'square' ? theme.palette.text.primary : theme.palette.grey[900],
backgroundColor:
variant === 'square' ? 'transparent' : theme.palette.background.paper,
}));
11 changes: 5 additions & 6 deletions packages/widget/src/config/theme.ts
Original file line number Diff line number Diff line change
Expand Up @@ -89,19 +89,18 @@ export const createTheme = (mode: PaletteMode) =>
},
},
},
MuiAvatar: {
MuiIconButton: {
styleOverrides: {
root: {
backgroundColor: '#fff',
height: 32,
width: 32,
color: 'inherit',
},
},
},
MuiIconButton: {
MuiAvatar: {
styleOverrides: {
root: {
color: 'inherit',
height: 32,
width: 32,
},
},
},
Expand Down
4 changes: 4 additions & 0 deletions packages/widget/src/pages/SwapPage/CircularProgress.style.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,10 @@ export const CircularProgress = styled(MuiCircularProgress, {

export const CircularProgressPending = styled(MuiCircularProgress)(
({ theme }) => ({
color:
theme.palette.mode === 'light'
? theme.palette.primary.main
: theme.palette.primary.light,
animationDuration: '3s',
position: 'absolute',
left: 0,
Expand Down
2 changes: 1 addition & 1 deletion packages/widget/src/pages/SwapPage/CircularProgress.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ export function CircularProgress({ status }: { status: Status }) {
value={100}
/>
{status === 'STARTED' || status === 'PENDING' ? (
<CircularProgressPending color="primary" size={32} thickness={3} />
<CircularProgressPending size={32} thickness={3} />
) : null}
{status === 'ACTION_REQUIRED' ? (
<InfoIcon
Expand Down

0 comments on commit fea0977

Please sign in to comment.