From 22d96b69f1c54b19ef2ef0d21283d2395b228c81 Mon Sep 17 00:00:00 2001 From: Tudor Stanciu Date: Fri, 25 Jun 2021 14:44:35 +0300 Subject: [PATCH] KeyOverwriteCard improvements --- src/components/common/ExpandableCard.js | 40 ++++++++++++------- .../advanced/keyOverwrite/KeyOverwriteCard.js | 1 + 2 files changed, 27 insertions(+), 14 deletions(-) diff --git a/src/components/common/ExpandableCard.js b/src/components/common/ExpandableCard.js index 61838b4..1c192f6 100644 --- a/src/components/common/ExpandableCard.js +++ b/src/components/common/ExpandableCard.js @@ -21,6 +21,7 @@ const ExpandableCard = ({ title, subtitle, smallHeader, + expandable, Summary, Content }) => { @@ -45,35 +46,46 @@ const ExpandableCard = ({ } action={ - - - + <> + {expandable && ( + + + + )} + } title={{title}} subheader={subtitle} /> {Summary && {Summary}} - - {Content} - + {expandable && ( + + {Content} + + )} ); }; +ExpandableCard.defaultProps = { + expandable: true +}; + ExpandableCard.propTypes = { Icon: PropTypes.node.isRequired, iconVariant: PropTypes.oneOf(["circle", "circular", "rounded", "square"]), title: PropTypes.string.isRequired, subtitle: PropTypes.string, smallHeader: PropTypes.bool, + expandable: PropTypes.bool, Summary: PropTypes.node, Content: PropTypes.node.isRequired }; diff --git a/src/features/forwards/options/components/advanced/keyOverwrite/KeyOverwriteCard.js b/src/features/forwards/options/components/advanced/keyOverwrite/KeyOverwriteCard.js index afce077..a3e3c1e 100644 --- a/src/features/forwards/options/components/advanced/keyOverwrite/KeyOverwriteCard.js +++ b/src/features/forwards/options/components/advanced/keyOverwrite/KeyOverwriteCard.js @@ -14,6 +14,7 @@ const KeyOverwriteCard = ({ data }) => { Icon={} title={t("Forward.Options.KeyOverwrite.Label")} subtitle={t("Forward.Options.KeyOverwrite.Tooltip")} + expandable={data.advancedSettings} Summary={} Content={} />