Skip to content

Commit

Permalink
fix: controls bar to only have valid classes
Browse files Browse the repository at this point in the history
  • Loading branch information
Belar committed Nov 22, 2024
1 parent 6e266c3 commit 0146b28
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 0146b28

Please sign in to comment.