mirror of
https://github.com/ajayyy/SponsorBlock.git
synced 2024-11-10 09:07:45 +01:00
Shrink chapter vote buttons
This commit is contained in:
parent
2369fcc92d
commit
7bbf2f1ce2
1 changed files with 7 additions and 4 deletions
|
@ -12,11 +12,13 @@ import { Tooltip } from "../render/Tooltip";
|
||||||
|
|
||||||
export interface ChapterVoteProps {
|
export interface ChapterVoteProps {
|
||||||
vote: (type: number, UUID: SegmentUUID, category?: Category) => Promise<VoteResponse>;
|
vote: (type: number, UUID: SegmentUUID, category?: Category) => Promise<VoteResponse>;
|
||||||
|
size?: string;
|
||||||
}
|
}
|
||||||
|
|
||||||
export interface ChapterVoteState {
|
export interface ChapterVoteState {
|
||||||
segment?: SponsorTime;
|
segment?: SponsorTime;
|
||||||
show: boolean;
|
show: boolean;
|
||||||
|
size: string;
|
||||||
}
|
}
|
||||||
|
|
||||||
class ChapterVoteComponent extends React.Component<ChapterVoteProps, ChapterVoteState> {
|
class ChapterVoteComponent extends React.Component<ChapterVoteProps, ChapterVoteState> {
|
||||||
|
@ -27,7 +29,8 @@ class ChapterVoteComponent extends React.Component<ChapterVoteProps, ChapterVote
|
||||||
|
|
||||||
this.state = {
|
this.state = {
|
||||||
segment: null,
|
segment: null,
|
||||||
show: false
|
show: false,
|
||||||
|
size: props.size ?? "22px"
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -47,7 +50,7 @@ class ChapterVoteComponent extends React.Component<ChapterVoteProps, ChapterVote
|
||||||
onClick={(e) => this.vote(e, 1)}>
|
onClick={(e) => this.vote(e, 1)}>
|
||||||
<ThumbsUpSvg className="playerButtonImage"
|
<ThumbsUpSvg className="playerButtonImage"
|
||||||
fill={Config.config.colorPalette.white}
|
fill={Config.config.colorPalette.white}
|
||||||
width={null} height={null} />
|
width={this.state.size} height={this.state.size} />
|
||||||
</button>
|
</button>
|
||||||
|
|
||||||
{/* Downvote Button */}
|
{/* Downvote Button */}
|
||||||
|
@ -97,8 +100,8 @@ class ChapterVoteComponent extends React.Component<ChapterVoteProps, ChapterVote
|
||||||
<ThumbsDownSvg
|
<ThumbsDownSvg
|
||||||
className="playerButtonImage"
|
className="playerButtonImage"
|
||||||
fill={downvoteButtonColor(this.state.segment ? [this.state.segment] : null, SkipNoticeAction.Downvote, SkipNoticeAction.Downvote)}
|
fill={downvoteButtonColor(this.state.segment ? [this.state.segment] : null, SkipNoticeAction.Downvote, SkipNoticeAction.Downvote)}
|
||||||
width={null}
|
width={this.state.size}
|
||||||
height={null} />
|
height={this.state.size} />
|
||||||
</button>
|
</button>
|
||||||
</>
|
</>
|
||||||
);
|
);
|
||||||
|
|
Loading…
Reference in a new issue