From 36e406a2ac5bf5c1b79f7e6cf32724c71eb4bc57 Mon Sep 17 00:00:00 2001 From: Charles de Dreuille Date: Mon, 10 Feb 2025 17:12:53 +0000 Subject: [PATCH] Update Button.tsx Signed-off-by: Charles de Dreuille --- packages/canon/src/components/Button/Button.tsx | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/packages/canon/src/components/Button/Button.tsx b/packages/canon/src/components/Button/Button.tsx index 5472e94607..97e9ec8fe5 100644 --- a/packages/canon/src/components/Button/Button.tsx +++ b/packages/canon/src/components/Button/Button.tsx @@ -17,8 +17,7 @@ import React, { forwardRef } from 'react'; import { Icon } from '../Icon'; import clsx from 'clsx'; -import { extractProps } from '../../utils/extractProps'; -import { buttonPropDefs } from './Button.props'; +import { useResponsiveValue } from '../../hooks/useResponsiveValue'; import type { ButtonProps } from './types'; @@ -32,16 +31,25 @@ export const Button = forwardRef( iconStart, iconEnd, children, + className, + style, ...rest } = props; - const { className, style } = extractProps(props, buttonPropDefs); + // Get the responsive value for the variant + const responsiveSize = useResponsiveValue(size); + const responsiveVariant = useResponsiveValue(variant); return (