123456789101112131415161718 |
- import React, { Component } from 'react';
- import './index.less';
- import Assets from '@src/components/Assets';
- export default class Switch extends Component {
- render() {
- const { checked, size = 'big', onClick } = this.props;
- return (
- <div className={`g-switch-wrapper ${checked ? 'checked' : ''} ${size}`}>
- <Assets
- className="g-switch"
- name={`swich_${checked ? 'on' : 'off'}_${size}`}
- onClick={() => onClick && onClick()}
- />
- </div>
- );
- }
- }
|