Skip to content

Commit

Permalink
change percentage steps
Browse files Browse the repository at this point in the history
  • Loading branch information
feruzm committed Mar 6, 2024
1 parent ad306ee commit af7744a
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions src/common/components/entry-vote-btn/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,7 @@ export class VoteDialog extends Component<VoteDialogProps, VoteDialogState> {
}

upSliderChanged = (value: number) => {
const upSliderVal = Number(value);
const upSliderVal = Number(value.toFixed(1));
const { initialVoteValues } = this.state;
const { upVoted } = this.props;
this.setState({
Expand All @@ -160,7 +160,7 @@ export class VoteDialog extends Component<VoteDialogProps, VoteDialogState> {
};

downSliderChanged = (value: number) => {
const downSliderVal = Number(value);
const downSliderVal = Number(value.toFixed(1));
const { initialVoteValues } = this.state;
const { upVoted, downVoted } = this.props;
this.setState({
Expand Down Expand Up @@ -324,7 +324,12 @@ export class VoteDialog extends Component<VoteDialogProps, VoteDialogState> {
</div>
<div className="space" />
<div className="slider slider-up">
<Slider axis="x" x={upSliderVal} onChange={({ x }) => this.upSliderChanged(x)} />
<Slider
axis="x"
xstep={0.1}
x={upSliderVal}
onChange={({ x }) => this.upSliderChanged(x)}
/>
</div>
<div className="percentage">{`${upSliderVal && upSliderVal.toFixed(1)}%`}</div>
<Button
Expand Down Expand Up @@ -376,6 +381,7 @@ export class VoteDialog extends Component<VoteDialogProps, VoteDialogState> {
<div className="slider slider-down">
<Slider
axis="x"
xstep={0.1}
x={downSliderVal}
onChange={({ x }) => this.downSliderChanged(x)}
/>
Expand Down

0 comments on commit af7744a

Please sign in to comment.