Skip to content

Commit

Permalink
fix: fix undefined image url (#92)
Browse files Browse the repository at this point in the history
  • Loading branch information
ueokande authored Mar 16, 2023
1 parent 8e267a7 commit abd423d
Showing 1 changed file with 5 additions and 8 deletions.
13 changes: 5 additions & 8 deletions src/console/components/console/CompletionItem.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,11 @@ import styled from "../../colorscheme/styled";

const Container = styled.li<{
shown: boolean;
icon: string;
icon?: string;
highlight: boolean;
}>`
background-image: ${({ icon }) => "url(" + icon + ")"};
background-image: ${({ icon }) =>
typeof icon !== "undefined" ? "url(" + icon + ")" : "unset"};
background-color: ${({ highlight, theme }) =>
highlight
? theme.completionSelectedBackground
Expand All @@ -15,7 +16,7 @@ const Container = styled.li<{
highlight
? theme.completionSelectedForeground
: theme.completionItemForeground};
display: ${({ shown }) => (shown ? "display" : "none")};
display: ${({ shown }) => (shown ? "block" : "none")};
padding-left: 1.8rem;
background-position: 0 center;
background-size: contain;
Expand Down Expand Up @@ -47,11 +48,7 @@ interface Props extends React.HTMLAttributes<HTMLElement> {
}

const CompletionItem: React.FC<Props> = (props) => (
<Container
icon={props.icon || ""}
aria-labelledby={`completion-item-${props.primary}`}
{...props}
>
<Container aria-labelledby={`completion-item-${props.primary}`} {...props}>
<Primary id={`completion-item-${props.primary}`}>{props.primary}</Primary>
<Secondary>{props.secondary}</Secondary>
</Container>
Expand Down

0 comments on commit abd423d

Please # to comment.