Shrink chapter vote buttons

This commit is contained in:
Ajay 2022-09-18 16:47:02 -04:00
parent 2369fcc92d
commit 7bbf2f1ce2

View file

@ -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>
</> </>
); );