重构目前所有的复制颜色代码功能使用统一的Hook。

This commit is contained in:
徐涛
2025-01-03 17:26:12 +08:00
parent 10f885526e
commit 69afcc369e
4 changed files with 15 additions and 67 deletions

View File

@@ -7,6 +7,7 @@ export function useCopyColor() {
const { showToast } = useNotification();
const [cpState, copyToClipboard] = useCopyToClipboard();
const copyAction = useCallback((color: string) => {
if (isNil(color)) return;
if (color.startsWith('#')) {
copyToClipboard(color);
} else {