mirror of
https://github.com/roleypoly/roleypoly-v1.git
synced 2025-06-17 10:39:09 +00:00
chore: remove semi
This commit is contained in:
parent
4b75eaa0ab
commit
8fcc0dcbf9
64 changed files with 1073 additions and 1073 deletions
|
@ -1,16 +1,16 @@
|
|||
import React, { Component } from 'react';
|
||||
import { Map } from 'immutable';
|
||||
import React, { Component } from 'react'
|
||||
import { Map } from 'immutable'
|
||||
|
||||
import Role from './index';
|
||||
import Role from './index'
|
||||
|
||||
export default class DemoRole extends Component {
|
||||
state = {
|
||||
isSelected: false,
|
||||
};
|
||||
}
|
||||
|
||||
handleToggle = () => {
|
||||
this.setState({ isSelected: !this.state.isSelected });
|
||||
};
|
||||
this.setState({ isSelected: !this.state.isSelected })
|
||||
}
|
||||
|
||||
render() {
|
||||
return (
|
||||
|
@ -20,6 +20,6 @@ export default class DemoRole extends Component {
|
|||
onToggle={this.handleToggle}
|
||||
type="button"
|
||||
/>
|
||||
);
|
||||
)
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
import React, { Component } from 'react';
|
||||
import { DragSource } from 'react-dnd';
|
||||
import React, { Component } from 'react'
|
||||
import { DragSource } from 'react-dnd'
|
||||
|
||||
import Role from './index';
|
||||
import Role from './index'
|
||||
|
||||
// @DragSource(Symbol.for('dnd: role'), {
|
||||
// beginDrag ({ role, categoryId }) {
|
||||
|
@ -17,7 +17,7 @@ export default
|
|||
Symbol.for('dnd: role'),
|
||||
{
|
||||
beginDrag({ role, categoryId }) {
|
||||
return { role, category: categoryId };
|
||||
return { role, category: categoryId }
|
||||
},
|
||||
},
|
||||
(connect, monitor) => ({
|
||||
|
@ -27,6 +27,6 @@ export default
|
|||
)
|
||||
class DraggableRole extends Component {
|
||||
render() {
|
||||
return <Role {...this.props} type="drag" />;
|
||||
return <Role {...this.props} type="drag" />
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,9 +1,9 @@
|
|||
import React, { Component } from 'react';
|
||||
import PropTypes from 'prop-types';
|
||||
import Color from 'color';
|
||||
import './Role.sass';
|
||||
import React, { Component } from 'react'
|
||||
import PropTypes from 'prop-types'
|
||||
import Color from 'color'
|
||||
import './Role.sass'
|
||||
|
||||
const whiteColor = Color('#efefef');
|
||||
const whiteColor = Color('#efefef')
|
||||
|
||||
class Role extends Component {
|
||||
static propTypes = {
|
||||
|
@ -12,28 +12,28 @@ class Role extends Component {
|
|||
type: PropTypes.string,
|
||||
selected: PropTypes.bool,
|
||||
disabled: PropTypes.bool,
|
||||
};
|
||||
}
|
||||
|
||||
render() {
|
||||
let { role, selected, disabled, type, isDragging } = this.props;
|
||||
type = type || 'button';
|
||||
let { role, selected, disabled, type, isDragging } = this.props
|
||||
type = type || 'button'
|
||||
|
||||
// console.log(this.props)
|
||||
|
||||
let color = Color(role.get('color'));
|
||||
let color = Color(role.get('color'))
|
||||
|
||||
if (color.rgbNumber() === 0) {
|
||||
color = whiteColor;
|
||||
color = whiteColor
|
||||
}
|
||||
|
||||
const c = color;
|
||||
let hc = color.lighten(0.1);
|
||||
const c = color
|
||||
let hc = color.lighten(0.1)
|
||||
|
||||
const out = (
|
||||
<div
|
||||
onClick={() => {
|
||||
if (!disabled && this.props.onToggle != null) {
|
||||
this.props.onToggle(!selected, selected);
|
||||
this.props.onToggle(!selected, selected)
|
||||
}
|
||||
}}
|
||||
{...(disabled
|
||||
|
@ -52,14 +52,14 @@ class Role extends Component {
|
|||
<div className={`role__option ${selected ? 'selected' : ''}`} />
|
||||
<div className="role__name">{role.get('name')}</div>
|
||||
</div>
|
||||
);
|
||||
)
|
||||
|
||||
if (type === 'drag' && this.props.connectDragSource != null) {
|
||||
return this.props.connectDragSource(out);
|
||||
return this.props.connectDragSource(out)
|
||||
}
|
||||
|
||||
return out;
|
||||
return out
|
||||
}
|
||||
}
|
||||
|
||||
export default Role;
|
||||
export default Role
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue