Browse Source

🎨 fix lgtm problems (#21273)

pull/21291/head
偏右 5 years ago
committed by GitHub
parent
commit
e36079c557
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
  1. 2
      scripts/azure-github-comment.js
  2. 6
      site/theme/template/Color/ColorPaletteToolDark.jsx
  3. 2
      site/theme/template/Color/Palette.jsx

2
scripts/azure-github-comment.js

@ -33,6 +33,7 @@ async function withGithub(url, json, method) {
// Find my comment
const updateComment = comments.find(({ body }) => body.includes(REPLACE_MARK));
// eslint-disable-next-line no-console
console.log('Origin comment:', updateComment);
// Update
@ -51,5 +52,6 @@ async function withGithub(url, json, method) {
);
}
// eslint-disable-next-line no-console
console.log(res);
})();

6
site/theme/template/Color/ColorPaletteToolDark.jsx

@ -13,8 +13,6 @@ export default class ColorPaletteTool extends Component {
primaryColor: '#1890ff',
backgroundColor: '#141414',
primaryColorInstance: null,
// eslint-disable-next-line react/no-unused-state
backgroundColorInstance: null,
};
handleChangeColor = (e, color) => {
@ -25,12 +23,10 @@ export default class ColorPaletteTool extends Component {
});
};
handleChangeBackgroundColor = (e, color) => {
handleChangeBackgroundColor = (e) => {
const value = e.target ? e.target.value : e;
this.setState({
backgroundColor: value,
// eslint-disable-next-line react/no-unused-state
backgroundColorInstance: color,
});
}

2
site/theme/template/Color/Palette.jsx

@ -42,7 +42,7 @@ export default class Palette extends React.Component {
const colorPaletteMap = {
dark: ['#fff', 'unset'],
default: ['rgba(0,0,0,0.85)', '#fff'],
}
};
const [lastColor, firstColor] = dark ? colorPaletteMap.dark : colorPaletteMap.default;
for (let i = 1; i <= count; i += 1) {
const colorText = `${name}-${i}`;

Loading…
Cancel
Save