zmp-react
Version:
Build full featured iOS & Android apps using ZMP & React
34 lines (33 loc) • 1.03 kB
JavaScript
import _extends from "@babel/runtime/helpers/extends";
import React, { useRef, forwardRef, useImperativeHandle } from 'react';
import ActionsButton from '../components/actions-button';
import { classNames } from '../shared/utils';
/* dts-props
id: string | number;
className: string;
style: React.CSSProperties;
bold: boolean;
close: boolean;
negative: boolean;
onClick? : (event?: any) => void
ref?: React.MutableRefObject<{el: HTMLElement | null}>;
COLOR_PROPS
CHILDREN_PROP
*/
var ZMPActionSButton = /*#__PURE__*/forwardRef(function (props, ref) {
var elRef = useRef(null);
var className = props.className,
negative = props.negative;
useImperativeHandle(ref, function () {
return elRef.current;
});
var classes = classNames({
'negative-button': negative
}, className);
return /*#__PURE__*/React.createElement(ActionsButton, _extends({}, props, {
className: classes,
ref: elRef
}));
});
ZMPActionSButton.displayName = 'zmp-actions-button';
export default ZMPActionSButton;