diff --git a/public/content.css b/public/content.css index ab8b8a02..830fcabd 100644 --- a/public/content.css +++ b/public/content.css @@ -198,6 +198,11 @@ div:hover > .sponsorBlockChapterBar { float: left; } +#categoryPill .sbPillNoText .sponsorSkipLogo { + margin-top: calc(2.6rem - 18px); + margin-bottom: calc(2.6rem - 18px); +} + @keyframes fadeIn { from { opacity: 0; } } @@ -772,6 +777,14 @@ input::-webkit-inner-spin-button { line-height: 1.5em; } +#categoryPillParent { + height: fit-content; + margin-top: auto; + margin-bottom: auto; + + position: relative; +} + .sponsorBlockCategoryPill { border-radius: 25px; padding-left: 8px; diff --git a/src/components/CategoryPillComponent.tsx b/src/components/CategoryPillComponent.tsx index 648983a7..ffcab365 100644 --- a/src/components/CategoryPillComponent.tsx +++ b/src/components/CategoryPillComponent.tsx @@ -12,6 +12,7 @@ import { getErrorMessage } from "../maze-utils/formating"; export interface CategoryPillProps { vote: (type: number, UUID: SegmentUUID, category?: Category) => Promise; + showTextByDefault: boolean; } export interface CategoryPillState { @@ -43,7 +44,7 @@ class CategoryPillComponent extends React.Component this.toggleOpen(e)} onMouseEnter={() => this.openTooltip()} @@ -52,9 +53,13 @@ class CategoryPillComponent extends React.Component - - {chrome.i18n.getMessage("category_" + this.state.segment?.category)} - + + { + (this.props.showTextByDefault || this.state.open) && + + {chrome.i18n.getMessage("category_" + this.state.segment?.category)} + + } {this.state.open && ( diff --git a/src/render/CategoryPill.tsx b/src/render/CategoryPill.tsx index 91380c24..2b277929 100644 --- a/src/render/CategoryPill.tsx +++ b/src/render/CategoryPill.tsx @@ -47,7 +47,7 @@ export class CategoryPill { this.root = createRoot(this.container); this.ref = React.createRef(); - this.root.render(); + this.root.render(); if (this.onMobileYouTube) { if (this.mutationObserver) { @@ -76,6 +76,7 @@ export class CategoryPill { // Use a parent because YouTube does weird things to the top level object // react would have to rerender if container was the top level const parent = document.createElement("span"); + parent.id = "categoryPillParent"; parent.appendChild(this.container); referenceNode.prepend(parent);