diff --git a/packages/yoga/src/Card/web/PlanCard/List.jsx b/packages/yoga/src/Card/web/PlanCard/List.jsx index d0288ad366..684547f06e 100644 --- a/packages/yoga/src/Card/web/PlanCard/List.jsx +++ b/packages/yoga/src/Card/web/PlanCard/List.jsx @@ -4,6 +4,7 @@ import { string, node, shape, oneOfType, func } from 'prop-types'; import Text from '../../../Text'; import theme from '../../../Theme/helpers/themeReader'; +import Box from '../../../Box'; const { card, cardweb } = theme.components; @@ -31,11 +32,20 @@ const Item = styled.li` } `; -const Wrapper = styled.div` +const Wrapper = styled(Box)` display: flex; min-width: 0; align-items: center; + ${props => + props.as === 'button' && + css` + border: none; + padding: 0; + background: transparent; + cursor: pointer; + `} + svg { flex-shrink: 0; } @@ -77,27 +87,35 @@ const Button = styled.button` `; const ListItem = withTheme( - ({ text, icon: Icon, buttonProps, theme: yogaTheme }) => ( - - - {Icon && ( - - {isValidElement(Icon) ? ( - Icon - ) : ( - - )} - + ({ text, icon: Icon, buttonProps, theme: yogaTheme, onClick }) => { + const wrapperProps = onClick + ? { as: 'button', type: 'button', onClick } + : {}; + + return ( + + + {Icon && ( + + {isValidElement(Icon) ? ( + Icon + ) : ( + + )} + + )} + {text} + + {Boolean(Object.keys(buttonProps).length) && ( + + +
  • + + + button + +
  • + + +
    + +
    + + +`; + exports[` Snapshots should render the discount 1`] = ` .c2 { margin: 0;