MCPcopy
hub / github.com/xotahal/react-native-material-ui / getIconSize

Function getIconSize

src/IconToggle/IconToggle.react.js:116–128  ·  view source on GitHub ↗

* Returns size of icon. Priority order: style prop, size prop, spacing.iconSize.

(props)

Source from the content-addressed store, hash-verified

114 * Returns size of icon. Priority order: style prop, size prop, spacing.iconSize.
115 */
116function getIconSize(props) {
117 const { spacing } = props.theme;
118 const { icon } = props.style;
119
120 if (icon && icon.width) {
121 return icon.width;
122 }
123 if (props.size) {
124 return props.size;
125 }
126
127 return spacing.iconSize;
128}
129function getContainerSize(iconSize) {
130 return iconSize * 2;
131}

Callers 2

constructorFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected