fix(CopyButton, LiveClock): 修改按钮大小为 'icon',移除硬编码颜色配置
This commit is contained in:
@@ -15,7 +15,7 @@ export const CopyButton: React.FC<CopyButtonProps> = ({
|
|||||||
text,
|
text,
|
||||||
tooltip,
|
tooltip,
|
||||||
variant = 'ghost',
|
variant = 'ghost',
|
||||||
size = 'sm',
|
size = 'icon',
|
||||||
className,
|
className,
|
||||||
...props
|
...props
|
||||||
}) => {
|
}) => {
|
||||||
@@ -55,7 +55,6 @@ export const CopyButton: React.FC<CopyButtonProps> = ({
|
|||||||
title={tooltip ?? t('buttons.copy')}
|
title={tooltip ?? t('buttons.copy')}
|
||||||
className={cn(
|
className={cn(
|
||||||
buttonVariants({ variant, size }),
|
buttonVariants({ variant, size }),
|
||||||
'h-8 w-8',
|
|
||||||
copied &&
|
copied &&
|
||||||
'bg-emerald-500/10 text-emerald-600 dark:text-emerald-400 hover:bg-emerald-500/10',
|
'bg-emerald-500/10 text-emerald-600 dark:text-emerald-400 hover:bg-emerald-500/10',
|
||||||
className,
|
className,
|
||||||
|
|||||||
@@ -88,8 +88,7 @@ const LiveClock = React.memo(({ unit, onUseNow, className, ...props }: LiveClock
|
|||||||
<CopyButton
|
<CopyButton
|
||||||
text={currentDisplay.text}
|
text={currentDisplay.text}
|
||||||
tooltip={t('timestamp:copyTsTooltip')}
|
tooltip={t('timestamp:copyTsTooltip')}
|
||||||
size="sm"
|
className="h-7 w-7 rounded-md border"
|
||||||
className="h-7 w-7 rounded-md border" // 移除了硬编码的颜色配置表,完全交由组件的内置 Class 渲染
|
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
);
|
);
|
||||||
|
|||||||
Reference in New Issue
Block a user