MCPcopy Create free account
hub / github.com/dailydotdev/apps / withIconSize

Function withIconSize

packages/shared/src/components/fields/TextField.tsx:121–129  ·  view source on GitHub ↗
(node: ReactNode)

Source from the content-addressed store, hash-verified

119 const iconSize = fieldSizeToIconSize[resolvedSize];
120 const gapClass = fieldSizeToGap[resolvedSize];
121 const withIconSize = (node: ReactNode): ReactNode => {
122 if (!React.isValidElement(node)) {
123 return node;
124 }
125 const element = node as React.ReactElement<IconProps>;
126 return React.cloneElement(element, {
127 size: element.props.size ?? iconSize,
128 });
129 };
130
131 return (
132 <BaseFieldContainer

Callers 1

TextFieldComponentFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected