Web:Components:DropDownItem: add available display icon as link

This commit is contained in:
TimofeyBoyko 2022-08-11 16:14:14 +03:00
parent 7e16507b41
commit ecf3da4668
2 changed files with 17 additions and 6 deletions

View File

@ -3,6 +3,7 @@ import PropTypes from "prop-types";
import { ReactSVG } from "react-svg";
import { StyledDropdownItem, IconWrapper } from "./styled-drop-down-item";
import { isNull } from "lodash";
const DropDownItem = (props) => {
//console.log("DropDownItem render");
@ -37,12 +38,16 @@ const DropDownItem = (props) => {
>
{icon && (
<IconWrapper>
{!withoutIcon && (
<ReactSVG
src={icon}
className={fillIcon ? "drop-down-item_icon" : ""}
/>
)}
{!withoutIcon ? (
icon.includes("https://") || icon.includes("http://") ? (
<img src={icon} />
) : (
<ReactSVG
src={icon}
className={fillIcon ? "drop-down-item_icon" : ""}
/>
)
) : null}
</IconWrapper>
)}

View File

@ -136,6 +136,12 @@ const IconWrapper = styled.div`
height: 100%;
}
}
img {
width: 100%;
max-width: 16px;
height: 100%;
max-height: 16px;
}
`;
IconWrapper.defaultProps = { theme: Base };