Skip to content

Commit 1183040

Browse files
committed
Chore: css
1 parent fd47db8 commit 1183040

File tree

5 files changed

+20
-18
lines changed

5 files changed

+20
-18
lines changed

src/components/v2/ProgressBar/index.stories.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ export const ValidProgressBar = () => (
1515

1616
export const ProgressBarWithCustomProgressColor = () => (
1717
<ProgressBar
18-
progressColorOverride="yellow"
18+
successColor="yellow"
1919
value={50}
2020
step={5}
2121
mark={75}

src/components/v2/ProgressBar/index.tsx

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ import { SliderTypeMap } from '@mui/material/Slider/Slider';
66

77
import { Tooltip, ITooltipProps } from '../Tooltip';
88
import { useStyles } from './styles';
9+
import { PALETTE } from '../../../theme/MuiThemeProvider/muiTheme';
910

1011
export interface IProgressBarProps {
1112
value: number;
@@ -19,7 +20,7 @@ export interface IProgressBarProps {
1920
markTooltip?: ITooltipProps['title'];
2021
className?: string;
2122
tooltipPlacement?: ITooltipProps['placement'];
22-
progressColorOverride?: string;
23+
successColor?: string;
2324
}
2425

2526
export const ProgressBar = ({
@@ -34,15 +35,15 @@ export const ProgressBar = ({
3435
markTooltip,
3536
className,
3637
tooltipPlacement = 'top',
37-
progressColorOverride,
38+
successColor = PALETTE.interactive.success,
3839
}: IProgressBarProps) => {
3940
const safeValue = value < max ? value : max;
4041

4142
const marks = mark ? [{ value: mark }] : undefined;
4243
const styles = useStyles({
4344
over: mark ? safeValue > mark : false,
4445
secondaryOver: mark ? !!(secondaryValue && secondaryValue > mark) : false,
45-
progressColorOverride,
46+
successColor,
4647
});
4748

4849
const renderMark = (props?: NonNullable<SliderTypeMap['props']['componentsProps']>['mark']) => (

src/components/v2/ProgressBar/styles.ts

Lines changed: 5 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -4,30 +4,25 @@ import { useTheme } from '@mui/material';
44
export const useStyles = ({
55
over,
66
secondaryOver,
7-
progressColorOverride,
7+
successColor,
88
}: {
99
over: boolean;
1010
secondaryOver: boolean;
11-
progressColorOverride?: string;
11+
successColor: string;
1212
}) => {
1313
const theme = useTheme();
1414
return {
1515
slider: css`
1616
display: block;
17-
color: ${over ? theme.palette.interactive.error50 : theme.palette.interactive.success};
18-
color: ${progressColorOverride};
17+
color: ${over ? theme.palette.interactive.error50 : successColor};
1918
background-color: ${theme.palette.background.default};
2019
height: ${theme.spacing(2)};
2120
padding: 0 !important;
2221
&.Mui-disabled {
23-
color: ${over ? theme.palette.interactive.error50 : theme.palette.interactive.success};
24-
color: ${progressColorOverride};
22+
color: ${over ? theme.palette.interactive.error50 : successColor};
2523
}
2624
.MuiSlider-track {
27-
background-color: ${over
28-
? theme.palette.interactive.error50
29-
: theme.palette.interactive.success};
30-
background-color: ${progressColorOverride};
25+
background-color: ${over ? theme.palette.interactive.error50 : successColor};
3126
height: ${theme.spacing(2)};
3227
border-radius: ${theme.spacing(1)};
3328
}

src/components/v2/VoteProposalUi/ActiveVotingProgress/index.tsx

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ export const ActiveVotingProgress: React.FC<IActiveVotingProgressProps> = ({
7272
label: t('voteProposalUi.statusCard.against'),
7373
value: getValueString(tokenId, votedAgainstWei),
7474
progressBarProps: {
75-
progressColorOverride: PALETTE.interactive.error50,
75+
successColor: PALETTE.interactive.error50,
7676
ariaLabel: t('voteProposalUi.statusCard.ariaLabelAgainst'),
7777
value: getValueNumber(tokenId, votedAgainstWei),
7878
},
@@ -82,7 +82,7 @@ export const ActiveVotingProgress: React.FC<IActiveVotingProgressProps> = ({
8282
label: t('voteProposalUi.statusCard.abstain'),
8383
value: getValueString(tokenId, abstainedWei),
8484
progressBarProps: {
85-
progressColorOverride: PALETTE.text.secondary,
85+
successColor: PALETTE.text.secondary,
8686
ariaLabel: t('voteProposalUi.statusCard.ariaLabelAbstain'),
8787
value: getValueNumber(tokenId, abstainedWei),
8888
},
@@ -92,7 +92,7 @@ export const ActiveVotingProgress: React.FC<IActiveVotingProgressProps> = ({
9292
);
9393

9494
return (
95-
<>
95+
<div css={styles.votesWrapper}>
9696
{activeProposalVotingData.map(({ id, label, value, progressBarProps }) => {
9797
if (!value) {
9898
return null;
@@ -112,6 +112,6 @@ export const ActiveVotingProgress: React.FC<IActiveVotingProgressProps> = ({
112112
</React.Fragment>
113113
);
114114
})}
115-
</>
115+
</div>
116116
);
117117
};

src/components/v2/VoteProposalUi/styles.ts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@ export const useStyles = () => {
2929
cardHeader: css`
3030
display: flex;
3131
justify-content: space-between;
32+
align-items: center;
3233
`,
3334
cardBadges: css`
3435
/* TODO */
@@ -80,6 +81,11 @@ export const useStyles = () => {
8081
`,
8182

8283
/* StatusCard styles */
84+
votesWrapper: css`
85+
display: flex;
86+
flex-direction: column;
87+
width: 100%;
88+
`,
8389
voteRow: css`
8490
display: flex;
8591
justify-content: space-between;

0 commit comments

Comments
 (0)