mirror of
https://github.com/mue/mue.git
synced 2026-07-09 05:34:20 +02:00
style: code changes etc
This commit is contained in:
@@ -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 = () => {
|
||||
|
||||
@@ -146,7 +146,7 @@ export default class Background extends React.PureComponent {
|
||||
requestURL = `${window.constants.UNSPLASH_URL}/getImage`;
|
||||
break;
|
||||
case 'pexels':
|
||||
requestURL = `${window.constants.PEXELS_URL}/getImage`;
|
||||
requestURL = `${window.constants.PEXELS_URL}/images/random`;
|
||||
break;
|
||||
// Defaults to Mue
|
||||
default:
|
||||
@@ -162,8 +162,13 @@ export default class Background extends React.PureComponent {
|
||||
}
|
||||
|
||||
let credit = data.photographer;
|
||||
if (backgroundAPI === 'unsplash') credit = data.photographer + ` ${this.language.unsplash}`;
|
||||
else if (backgroundAPI === 'pexels') credit = data.photographer + ` ${this.language.pexels}`;
|
||||
if (backgroundAPI === 'unsplash') {
|
||||
credit = data.photographer + ` ${this.language.unsplash}`;
|
||||
} else if (backgroundAPI === 'pexels') {
|
||||
credit = data.photographer + ` ${this.language.pexels}`;
|
||||
}
|
||||
|
||||
const location = data.location.replace(/[null]+/g, '');
|
||||
|
||||
this.setState({
|
||||
url: data.file,
|
||||
@@ -172,7 +177,7 @@ export default class Background extends React.PureComponent {
|
||||
photoInfo: {
|
||||
hidden: false,
|
||||
credit: credit,
|
||||
location: (data.location.replace(/[null]+/g, '') !== ' ') ? data.location : 'N/A',
|
||||
location: (location !== ' ' && location !== ', ') ? data.location : 'N/A',
|
||||
camera: data.camera,
|
||||
resolution: data.resolution,
|
||||
url: data.file,
|
||||
|
||||
Reference in New Issue
Block a user