MCPcopy
hub / github.com/nygardk/react-share / getButtonBorderRadius

Function getButtonBorderRadius

src/ShareButton.tsx:54–72  ·  view source on GitHub ↗
(children: React.ReactNode)

Source from the content-addressed store, hash-verified

52});
53
54function getButtonBorderRadius(children: React.ReactNode) {
55 const childNodes = Children.toArray(children);
56
57 if (childNodes.length !== 1) {
58 return undefined;
59 }
60
61 const [child] = childNodes;
62
63 if (!isValidElement<IconShapeProps>(child)) {
64 return undefined;
65 }
66
67 if (child.props.round) {
68 return '50%';
69 }
70
71 return child.props.borderRadius ?? 0;
72}
73
74function hasTextContent(children: React.ReactNode): boolean {
75 return Children.toArray(children).some(child => {

Callers 1

ShareButtonFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…