MCPcopy Index your code
hub / github.com/bernaferrari/FigmaToCode / composeContainer

Function composeContainer

packages/backend/src/compose/composeMain.ts:202–219  ·  view source on GitHub ↗
(node: SceneNode, child: string)

Source from the content-addressed store, hash-verified

200};
201
202const composeContainer = (node: SceneNode, child: string): string => {
203 let propChild = "";
204
205 if ("fills" in node && node.fills !== figma.mixed && retrieveTopFill(node.fills as any)?.type === "IMAGE") {
206 addWarning("Image fills are replaced with placeholders in Compose");
207 }
208
209 if (child.length > 0) {
210 propChild = child;
211 }
212
213 const builder = new ComposeDefaultBuilder(propChild)
214 .createContainer(node)
215 .blendAttr(node)
216 .position(node);
217
218 return builder.child;
219};
220
221const composeText = (node: TextNode): string => {
222 const builder = new ComposeTextBuilder().createText(node);

Callers 3

composeWidgetGeneratorFunction · 0.70
composeGroupFunction · 0.70
composeFrameFunction · 0.70

Calls 5

retrieveTopFillFunction · 0.90
addWarningFunction · 0.90
positionMethod · 0.45
blendAttrMethod · 0.45
createContainerMethod · 0.45

Tested by

no test coverage detected