From b4218a48f26e4aa7a7dab98a7a9989f2b056518e Mon Sep 17 00:00:00 2001 From: Nicolay Arefyeu Date: Fri, 8 Mar 2024 14:12:41 +0200 Subject: [PATCH 01/13] Updated button specification with Icon --- src/components/Button/index.tsx | 4 +++- src/components/Icon/index.tsx | 11 +++++++++-- src/pages/workspace/WorkspaceProfilePage.tsx | 2 ++ src/styles/index.ts | 8 +++----- src/styles/utils/index.ts | 16 ++++++++++++++++ 5 files changed, 33 insertions(+), 8 deletions(-) diff --git a/src/components/Button/index.tsx b/src/components/Button/index.tsx index ca1bc391e800..c81975b96aab 100644 --- a/src/components/Button/index.tsx +++ b/src/components/Button/index.tsx @@ -237,11 +237,13 @@ function Button( {icon && ( - + )} diff --git a/src/components/Icon/index.tsx b/src/components/Icon/index.tsx index d3214565ba46..f0574c32f3b5 100644 --- a/src/components/Icon/index.tsx +++ b/src/components/Icon/index.tsx @@ -25,6 +25,12 @@ type IconProps = { /** Is small icon */ small?: boolean; + /** Is large icon */ + large?: boolean; + + /** Is medium large */ + medium?: boolean; + /** Is inline icon */ inline?: boolean; @@ -50,6 +56,8 @@ function Icon({ height = variables.iconSizeNormal, fill = undefined, small = false, + large = false, + medium = false, inline = false, additionalStyles = [], hovered = false, @@ -59,8 +67,7 @@ function Icon({ }: IconProps) { const StyleUtils = useStyleUtils(); const styles = useThemeStyles(); - const iconWidth = small ? variables.iconSizeSmall : width; - const iconHeight = small ? variables.iconSizeSmall : height; + const {width: iconWidth, height: iconHeight} = StyleUtils.getIconWidthAndHeightStyle(small, medium, large, width, height) const iconStyles = [StyleUtils.getWidthAndHeightStyle(width ?? 0, height), IconWrapperStyles, styles.pAbsolute, additionalStyles]; if (inline) { diff --git a/src/pages/workspace/WorkspaceProfilePage.tsx b/src/pages/workspace/WorkspaceProfilePage.tsx index 9d90557b1d37..30b17cd197f4 100644 --- a/src/pages/workspace/WorkspaceProfilePage.tsx +++ b/src/pages/workspace/WorkspaceProfilePage.tsx @@ -193,6 +193,7 @@ function WorkspaceProfilePage({policy, currencyList = {}, route}: WorkSpaceProfi text={translate('common.share')} onPress={onPressShare} medium + icon={Expensicons.QrCode} />