mirror of
https://github.com/ant-design/ant-design.git
synced 2024-12-19 03:54:28 +08:00
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
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:
parent
1c41f642ae
commit
d4d6492369
@ -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);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -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);
|
||||||
|
@ -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();
|
||||||
};
|
};
|
||||||
|
@ -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;
|
||||||
|
Loading…
Reference in New Issue
Block a user