From 51afd9fb812db2ae32a11463bdfa49edf54e537f 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: Fri, 25 Oct 2024 09:19:51 +0200 Subject: [PATCH] feat(components): add new prop to hide icon in `TotalLayoutHeader` Ticket: issue/Community-300 Reviewed-by: @MIGUELez11 Refs: #198 --- .../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}}