From 2aa31e431c10791e223dfece9d239091e310d8c9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fernando=20Mar=C3=ADn=20S=C3=A1nchez?= <46426271+fermarinsanchez@users.noreply.github.com> Date: Wed, 23 Oct 2024 16:17:49 +0200 Subject: [PATCH] feat(components): Add new prop to handle show icon or not (noIcon prop: boolean) on TotalLayoutHeader. --- .../TotalLayoutHeader/TotalLayoutHeader.constants.js | 2 ++ .../layout/TotalLayout/TotalLayoutHeader/TotalLayoutHeader.js | 3 ++- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/packages/components/src/layout/TotalLayout/TotalLayoutHeader/TotalLayoutHeader.constants.js b/packages/components/src/layout/TotalLayout/TotalLayoutHeader/TotalLayoutHeader.constants.js index 402385a0..5bff9d90 100644 --- a/packages/components/src/layout/TotalLayout/TotalLayoutHeader/TotalLayoutHeader.constants.js +++ b/packages/components/src/layout/TotalLayout/TotalLayoutHeader/TotalLayoutHeader.constants.js @@ -13,6 +13,7 @@ export const TOTAL_LAYOUT_HEADER_PROP_TYPES = { cancelable: PropTypes.bool, direction: PropTypes.oneOf(['row', 'column']), rightZone: PropTypes.node, + noIcon: PropTypes.bool, }; export const TOTAL_LAYOUT_HEADER_DEFAULT_PROPS = { @@ -24,6 +25,7 @@ export const TOTAL_LAYOUT_HEADER_DEFAULT_PROPS = { cancelable: true, direction: 'column', rightZone: null, + noIcon: false, }; export const TOTAL_LAYOUT_HEADER_HEIGHT = 72; diff --git a/packages/components/src/layout/TotalLayout/TotalLayoutHeader/TotalLayoutHeader.js b/packages/components/src/layout/TotalLayout/TotalLayoutHeader/TotalLayoutHeader.js index 416226ce..aa4f35d2 100644 --- a/packages/components/src/layout/TotalLayout/TotalLayoutHeader/TotalLayoutHeader.js +++ b/packages/components/src/layout/TotalLayout/TotalLayoutHeader/TotalLayoutHeader.js @@ -25,6 +25,7 @@ const TotalLayoutHeader = ({ cancelable = true, mainActionLabel = 'Cancelar', rightZone = null, + noIcon = false, ...props }) => { const formContext = useFormContext(); @@ -50,7 +51,7 @@ const TotalLayoutHeader = ({ {/* ICON & LABELS */} - {icon} + {!noIcon && {icon}}