@nexara/nativeflow
Version:
Beautiful, responsive, and customizable UI components for React Native – built for performance and seamless experiences.
37 lines (36 loc) • 947 B
JavaScript
import React, { isValidElement } from "react";
import { TouchableOpacity } from "react-native";
import Icon from "../Icon/Icon.js";
import { jsx as _jsx, Fragment as _Fragment } from "react/jsx-runtime";
const IconButton = ({
rippleColor,
children,
style,
...rest
}) => {
let size = 40;
if (!(/*#__PURE__*/isValidElement(children) && 'size' in children.props)) {
return;
}
size = children.props.size * 1.5;
return /*#__PURE__*/_jsx(_Fragment, {
children: /*#__PURE__*/_jsx(TouchableOpacity
// rippleColor={rippleColor}
, {
style: [{
borderRadius: 100,
height: size,
width: size,
justifyContent: 'center',
alignItems: 'center'
}, style],
...rest,
children: /*#__PURE__*/_jsx(Icon, {
renderIcon: /*#__PURE__*/React.cloneElement(children)
})
})
});
};
export default IconButton;
//# sourceMappingURL=IconButton.js.map
;