style: code changes etc

This commit is contained in:
David Ralph
2021-05-05 15:44:39 +01:00
parent fa19570c36
commit 260d1928d8
2 changed files with 15 additions and 10 deletions

View File

@@ -25,14 +25,14 @@ const widget_name = {
date: settings.time.date.title
};
const SortableItem = sortableElement(({value}) => (
const SortableItem = sortableElement(({ value }) => (
<li className='sortableitem' style={{ display: enabled(value) ? 'block' : 'none' }}>
<DragHandleIcon style={{'verticalAlign': 'middle'}} />
{widget_name[value]}
</li>
));
const SortableContainer = sortableContainer(({children}) => {
const SortableContainer = sortableContainer(({ children }) => {
return <ul className='sortablecontainer'>{children}</ul>;
});
@@ -65,10 +65,10 @@ export default class OrderSettings extends React.PureComponent {
return newArray;
}
onSortEnd = ({oldIndex, newIndex}) => {
this.setState(({items}) => ({
items: this.arrayMove(items, oldIndex, newIndex)
}));
onSortEnd = ({ oldIndex, newIndex }) => {
this.setState({
items: this.arrayMove(this.state.items, oldIndex, newIndex)
});
}
reset = () => {