向通用颜色展示卡片增加换气ContextMenu功能。
This commit is contained in:
		@@ -11,12 +11,19 @@
 | 
				
			|||||||
    .color_block {
 | 
					    .color_block {
 | 
				
			||||||
      flex: 1 0;
 | 
					      flex: 1 0;
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
    .color_value {
 | 
					    .operate_row {
 | 
				
			||||||
      padding: var(--spacing-xxs) var(--spacing-xs);
 | 
					      padding: var(--spacing-xxs) var(--spacing-xs);
 | 
				
			||||||
      font-size: var(--font-size-xs);
 | 
					      font-size: var(--font-size-xs);
 | 
				
			||||||
 | 
					      display: flex;
 | 
				
			||||||
 | 
					      flex-direction: row;
 | 
				
			||||||
 | 
					      justify-content: flex-end;
 | 
				
			||||||
 | 
					      align-items: center;
 | 
				
			||||||
 | 
					      gap: var(--spacing-s);
 | 
				
			||||||
 | 
					      .color_value {
 | 
				
			||||||
        text-align: right;
 | 
					        text-align: right;
 | 
				
			||||||
        text-transform: uppercase;
 | 
					        text-transform: uppercase;
 | 
				
			||||||
        cursor: pointer;
 | 
					        cursor: pointer;
 | 
				
			||||||
      }
 | 
					      }
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
  }
 | 
					  }
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -1,6 +1,7 @@
 | 
				
			|||||||
import { useMemo } from 'react';
 | 
					import { useMemo } from 'react';
 | 
				
			||||||
import { useColorFunction } from '../ColorFunctionContext';
 | 
					import { useColorFunction } from '../ColorFunctionContext';
 | 
				
			||||||
import { useCopyColor } from '../hooks/useCopyColor';
 | 
					import { useCopyColor } from '../hooks/useCopyColor';
 | 
				
			||||||
 | 
					import ContextMenu from './ContextMenu';
 | 
				
			||||||
import styles from './FlexColorStand.module.css';
 | 
					import styles from './FlexColorStand.module.css';
 | 
				
			||||||
 | 
					
 | 
				
			||||||
type FlexColorStandProps = {
 | 
					type FlexColorStandProps = {
 | 
				
			||||||
@@ -51,9 +52,12 @@ export function FlexColorStand({ color, valueMode = 'hex' }: FlexColorStandProps
 | 
				
			|||||||
  return (
 | 
					  return (
 | 
				
			||||||
    <div className={styles.color_stand}>
 | 
					    <div className={styles.color_stand}>
 | 
				
			||||||
      <div className={styles.color_block} style={{ backgroundColor: bgColor }} />
 | 
					      <div className={styles.color_block} style={{ backgroundColor: bgColor }} />
 | 
				
			||||||
 | 
					      <div className={styles.operate_row}>
 | 
				
			||||||
        <div className={styles.color_value} onClick={() => copyToClipboard(colorValue)}>
 | 
					        <div className={styles.color_value} onClick={() => copyToClipboard(colorValue)}>
 | 
				
			||||||
          {bgColor}
 | 
					          {bgColor}
 | 
				
			||||||
        </div>
 | 
					        </div>
 | 
				
			||||||
 | 
					        <ContextMenu color={color} />
 | 
				
			||||||
 | 
					      </div>
 | 
				
			||||||
    </div>
 | 
					    </div>
 | 
				
			||||||
  );
 | 
					  );
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user