1
0
mirror of https://github.com/haiwen/seahub.git synced 2025-09-17 07:41:26 +00:00

feat: react warning (#7467)

Co-authored-by: 杨国璇 <ygx@Hello-word.local>
This commit is contained in:
杨国璇
2025-02-17 11:50:29 +08:00
committed by GitHub
parent 91b9a7840f
commit 06410d217d
33 changed files with 105 additions and 154 deletions

View File

@@ -4,8 +4,7 @@ import classnames from 'classnames';
import '../../../css/switch.css';
function Switch(props) {
const { onChange, checked, placeholder, disabled, className, size, textPosition, setRef } = props;
function Switch({ onChange, checked, placeholder, disabled, className, size, textPosition = 'left', setRef }) {
return (
<div className={classnames('seahub-switch position-relative', className, size)} ref={setRef}>
<label className="custom-switch">
@@ -40,8 +39,4 @@ Switch.propTypes = {
setRef: PropTypes.func
};
Switch.defaultProps = {
textPosition: 'left',
};
export default Switch;