site: fix some eslint error (#51901)
Some checks are pending
Publish Any Commit / build (push) Waiting to run
🔀 Sync mirror to Gitee / mirror (push) Waiting to run
✅ test / lint (push) Waiting to run
✅ test / test-react-legacy (16, 1/2) (push) Waiting to run
✅ test / test-react-legacy (16, 2/2) (push) Waiting to run
✅ test / test-react-legacy (17, 1/2) (push) Waiting to run
✅ test / test-react-legacy (17, 2/2) (push) Waiting to run
✅ test / test-node (push) Waiting to run
✅ test / test-react-latest (dom, 1/2) (push) Waiting to run
✅ test / test-react-latest (dom, 2/2) (push) Waiting to run
✅ test / test-react-latest-dist (dist, 1/2) (push) Blocked by required conditions
✅ test / test-react-latest-dist (dist, 2/2) (push) Blocked by required conditions
✅ test / test-react-latest-dist (dist-min, 1/2) (push) Blocked by required conditions
✅ test / test-react-latest-dist (dist-min, 2/2) (push) Blocked by required conditions
✅ test / test-coverage (push) Blocked by required conditions
✅ test / build (push) Waiting to run
✅ test / test lib/es module (es, 1/2) (push) Waiting to run
✅ test / test lib/es module (es, 2/2) (push) Waiting to run
✅ test / test lib/es module (lib, 1/2) (push) Waiting to run
✅ test / test lib/es module (lib, 2/2) (push) Waiting to run
👁️ Visual Regression Persist Start / test image (push) Waiting to run

This commit is contained in:
lijianan 2024-12-04 23:56:09 +08:00 committed by GitHub
parent 1c41f642ae
commit d4d6492369
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
4 changed files with 22 additions and 14 deletions

View File

@ -1,7 +1,7 @@
import React, { useMemo, useState } from 'react'; import React, { useMemo, useState } from 'react';
import { Col, ColorPicker, Row } from 'antd'; import { Col, ColorPicker, Row } from 'antd';
import { FormattedMessage } from 'dumi';
import type { Color } from 'antd/es/color-picker'; import type { Color } from 'antd/es/color-picker';
import { FormattedMessage } from 'dumi';
import useLocale from '../../../hooks/useLocale'; import useLocale from '../../../hooks/useLocale';
import ColorPatterns from './ColorPatterns'; import ColorPatterns from './ColorPatterns';
@ -34,7 +34,7 @@ const ColorPaletteTool: React.FC = () => {
setPrimaryColorInstance(color); setPrimaryColorInstance(color);
}; };
const handleChangeBackgroundColor = (_, hex: string) => { const handleChangeBackgroundColor = (_: Color, hex: string) => {
setBackgroundColor(hex); setBackgroundColor(hex);
}; };

View File

@ -5,6 +5,9 @@ import CopyToClipboard from 'react-copy-to-clipboard';
const rgbToHex = (rgbString: string): string => { const rgbToHex = (rgbString: string): string => {
const rgb = rgbString.match(/\d+/g); const rgb = rgbString.match(/\d+/g);
if (!rgb) {
return '';
}
let r = parseInt(rgb[0], 10).toString(16); let r = parseInt(rgb[0], 10).toString(16);
let g = parseInt(rgb[1], 10).toString(16); let g = parseInt(rgb[1], 10).toString(16);
let b = parseInt(rgb[2], 10).toString(16); let b = parseInt(rgb[2], 10).toString(16);

View File

@ -1,16 +1,20 @@
import React, { useEffect, useRef } from 'react'; import React, { useEffect, useRef } from 'react';
import type { JSONEditorPropsOptional } from 'vanilla-jsoneditor'; import type { JsonEditor, JSONEditorPropsOptional } from 'vanilla-jsoneditor';
import { JSONEditor, Mode } from 'vanilla-jsoneditor'; import { createJSONEditor, Mode } from 'vanilla-jsoneditor';
const Editor: React.FC<JSONEditorPropsOptional> = (props) => { const Editor: React.FC<JSONEditorPropsOptional> = (props) => {
const editorRef = useRef<JSONEditor>(null); const editorRef = useRef<JsonEditor>();
const container = useRef<HTMLDivElement>(null); const container = useRef<HTMLDivElement>(null);
useEffect(() => { useEffect(() => {
editorRef.current = new JSONEditor({ if (container.current) {
editorRef.current = createJSONEditor({
target: container.current, target: container.current,
props: { mode: Mode.text }, props: {
mode: Mode.text,
},
}); });
}
return () => { return () => {
editorRef.current?.destroy(); editorRef.current?.destroy();
}; };

View File

@ -347,6 +347,7 @@ const GlobalDemoStyles: React.FC = () => {
display: flex; display: flex;
align-items: center; align-items: center;
column-gap: ${token.marginXS}px; column-gap: ${token.marginXS}px;
}
${antCls}-btn { ${antCls}-btn {
opacity: 0.6; opacity: 0.6;