KeyOverwriteCard improvements
parent
4dc2b3e25e
commit
22d96b69f1
|
@ -21,6 +21,7 @@ const ExpandableCard = ({
|
|||
title,
|
||||
subtitle,
|
||||
smallHeader,
|
||||
expandable,
|
||||
Summary,
|
||||
Content
|
||||
}) => {
|
||||
|
@ -45,6 +46,8 @@ const ExpandableCard = ({
|
|||
</Avatar>
|
||||
}
|
||||
action={
|
||||
<>
|
||||
{expandable && (
|
||||
<IconButton
|
||||
className={clsx(classes.expand, {
|
||||
[classes.expandOpen]: expanded
|
||||
|
@ -56,24 +59,33 @@ const ExpandableCard = ({
|
|||
>
|
||||
<ExpandMoreIcon />
|
||||
</IconButton>
|
||||
)}
|
||||
</>
|
||||
}
|
||||
title={<strong>{title}</strong>}
|
||||
subheader={subtitle}
|
||||
/>
|
||||
{Summary && <CardContent>{Summary}</CardContent>}
|
||||
{expandable && (
|
||||
<Collapse in={expanded} timeout="auto" unmountOnExit>
|
||||
<CardContent>{Content}</CardContent>
|
||||
</Collapse>
|
||||
)}
|
||||
</Card>
|
||||
);
|
||||
};
|
||||
|
||||
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
|
||||
};
|
||||
|
|
|
@ -14,6 +14,7 @@ const KeyOverwriteCard = ({ data }) => {
|
|||
Icon={<FindReplaceIcon />}
|
||||
title={t("Forward.Options.KeyOverwrite.Label")}
|
||||
subtitle={t("Forward.Options.KeyOverwrite.Tooltip")}
|
||||
expandable={data.advancedSettings}
|
||||
Summary={<KeyOverwriteSummary data={data} />}
|
||||
Content={<AdvancedSettingsComponent data={data.advancedSettings} />}
|
||||
/>
|
||||
|
|
Loading…
Reference in New Issue