Skip to content

Commit

Permalink
Merge pull request #25 from author-more/fix/controls-bar-class
Browse files Browse the repository at this point in the history
fix: controls bar to only have valid classes
  • Loading branch information
Belar authored Nov 23, 2024
2 parents 6e266c3 + 0146b28 commit c74767e
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion src/ControlsBar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,13 @@ export default function ControlsBar({
stickTo,
growFirstItem,
}: ControlsBar) {
const className = `controls-bar ${stickTo && `sticky ${stickTo}`} ${growFirstItem ? "grow-first" : ""}`;
const className = [
"controls-bar",
(stickTo && `sticky ${stickTo}`) || "",
(growFirstItem && "grow-first") || "",
]
.filter(Boolean)
.join(" ");

return <div className={className}>{children}</div>;
}

0 comments on commit c74767e

Please sign in to comment.