Skip to content

Commit cd7c0fb

Browse files
committed
refactor(bem): replace Block with cn() in Choices.jsx
Migrated Choices tag component from Block to cn() helper. - Replaced Block import with cn import - Replaced <Block name="choices"> with <div className={cn("choices")...}> - No Elems in this file (simple wrapper for Choice children) - Preserved ref, mods, and Tree.renderChildren call - Added type assertion for ref - No behavior change, equivalent class strings
1 parent 7cda132 commit cd7c0fb

File tree

1 file changed

+5
-6
lines changed

1 file changed

+5
-6
lines changed

web/libs/editor/src/tags/control/Choices.jsx

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ import Types from "../../core/Types";
1212
import { guidGenerator } from "../../core/Helpers";
1313
import ControlBase from "./Base";
1414
import { AnnotationMixin } from "../../mixins/AnnotationMixin";
15-
import { Block } from "../../utils/bem";
15+
import { cn } from "../../utils/bem";
1616
import "./Choices/Choices.scss";
1717

1818
import "./Choice";
@@ -292,13 +292,12 @@ const ChoicesSelectLayout = observer(({ item }) => {
292292

293293
const HtxChoices = observer(({ item }) => {
294294
return (
295-
<Block
296-
name="choices"
297-
mod={{ hidden: !item.isVisible || !item.perRegionVisible(), layout: item.layout }}
298-
ref={item.elementRef}
295+
<div
296+
className={cn("choices").mod({ hidden: !item.isVisible || !item.perRegionVisible(), layout: item.layout }).toClassName()}
297+
ref={item.elementRef as any}
299298
>
300299
{item.layout === "select" ? <ChoicesSelectLayout item={item} /> : Tree.renderChildren(item, item.annotation)}
301-
</Block>
300+
</div>
302301
);
303302
});
304303

0 commit comments

Comments
 (0)