@fruits-chain/react-native-xiaoshu
Version:
🌈 React Native UI library
41 lines (39 loc) • 1.14 kB
JavaScript
import { CircleOutline, SuccessFill } from '@fruits-chain/icons-react-native';
import React, { memo } from 'react';
import { getDefaultValue } from "../helpers/index.js";
import Theme from "../theme/index.js";
import { varCreator } from "./style.js";
import { jsx as _jsx } from "react/jsx-runtime";
const CheckboxIcon = ({
theme,
active,
activeColor,
size,
disabled,
...restProps
}) => {
const [CV] = Theme.useStyle({
varCreator,
theme
});
// 从配置中拿默认值
size = getDefaultValue(size, CV.checkbox_icon_size);
activeColor = getDefaultValue(activeColor, CV.checkbox_checked_icon_color);
if (active) {
return /*#__PURE__*/_jsx(SuccessFill, {
...restProps,
size: size,
color: disabled ? CV.checkbox_checked_icon_disabled_color : activeColor,
disabled: disabled
});
}
return /*#__PURE__*/_jsx(CircleOutline, {
...restProps,
size: size,
disabled: disabled,
color: disabled ? CV.checkbox_icon_disabled_color : CV.checkbox_icon_color
});
};
export default /*#__PURE__*/memo(CheckboxIcon);
//# sourceMappingURL=checkbox-icon.js.map
;