mirror of
https://github.com/ajayyy/SponsorBlock.git
synced 2025-12-09 21:17:20 +03:00
22 lines
788 B
TypeScript
22 lines
788 B
TypeScript
import Config from "../config";
|
|
import { SponsorTime } from "../types";
|
|
|
|
export enum SkipNoticeAction {
|
|
None,
|
|
Upvote,
|
|
Downvote,
|
|
CategoryVote,
|
|
CopyDownvote,
|
|
Unskip0,
|
|
Unskip1
|
|
}
|
|
|
|
export function downvoteButtonColor(segments: SponsorTime[], actionState: SkipNoticeAction, downvoteType: SkipNoticeAction): string {
|
|
// Also used for "Copy and Downvote"
|
|
if (segments?.length > 1) {
|
|
return (actionState === downvoteType) ? Config.config.colorPalette.red : Config.config.colorPalette.white;
|
|
} else {
|
|
// You dont have segment selectors so the lockbutton needs to be colored and cannot be selected.
|
|
return Config.config.isVip && segments?.[0].locked === 1 ? Config.config.colorPalette.locked : Config.config.colorPalette.white;
|
|
}
|
|
} |