Web:Components:DropDownItem: add available display icon as link
This commit is contained in:
parent
7e16507b41
commit
ecf3da4668
@ -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 && (
|
||||
{!withoutIcon ? (
|
||||
icon.includes("https://") || icon.includes("http://") ? (
|
||||
<img src={icon} />
|
||||
) : (
|
||||
<ReactSVG
|
||||
src={icon}
|
||||
className={fillIcon ? "drop-down-item_icon" : ""}
|
||||
/>
|
||||
)}
|
||||
)
|
||||
) : null}
|
||||
</IconWrapper>
|
||||
)}
|
||||
|
||||
|
@ -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 };
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user