"dependencies": {
"cordova-android": "^7.0.0",
"cordova-ios": "^4.5.4",
"cordova-plugin-whitelist": "^1.3.3",
"react": "^16.3.1",
"react-dom": "^16.3.1",
"react-redux": "^5.0.7",
"react-switch-button": "^2.3.0",
"redux": "^3.7.2",
"webpack": "^4.5.0"
}
import React from 'react'
import ImgArrow from '../../../../../img/list_arrow.png'
import style from './setting_drawable.css'
import SwitchButton from 'react-switch-button'
const SettingDrawable = (props) => {
let type = props.Type
if (props.Type === '' || props.Type === null) {
// default drawable
type = 'SELECTION_DEFAULT'
}
let drawable = <img className = {style.DrawableSource} src={ImgArrow} />
if (type === 'SELECTION_DEFAULT') {
drawable = <img className = {style.DrawableSource} src={ImgArrow} />
} else if (type === 'TOGGLE') {
drawable = <SwitchButton name={ props.name } checked={ props.on } />
}
return (
<div className = {style.SettingDrawable}>{ drawable }</div>
)
}
export default SettingDrawable
ERROR in ./node_modules/react-switch-button/src/react-switch-button.jsx
Module parse failed: Unexpected token (31:8)
You may need an appropriate loader to handle this file type.
|
| return (
| <div className={classes.join( " " ).trim()}>
| {
| (this.props.label.length > 0)
@ ./www/js/components/Settings/SettingElement/SettingDrawable/SettingDrawable.js 19:25-55