Skip to content

Commit

Permalink
Merge pull request #312 from 10up/fix/styling-of-search-item
Browse files Browse the repository at this point in the history
Fix: styling of search results in ContentSearch component
  • Loading branch information
fabiankaegy authored Apr 16, 2024
2 parents 9fc0f7d + 434edbe commit 04c49b2
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 3 deletions.
1 change: 1 addition & 0 deletions components/content-search/SearchItem.js
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ const ButtonStyled = styled(Button)`
.block-editor-link-control__search-item-header {
display: flex;
flex-direction: column;
align-items: flex-start;
}
mark {
Expand Down
14 changes: 11 additions & 3 deletions components/content-search/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,14 @@ const LoadingContainer = styled.div`
}
`;

const StyledNavigableMenu = styled(NavigableMenu)`
width: 100%;
`;

const StyledSearchControl = styled(SearchControl)`
width: 100%;
`;

const ContentSearch = ({
onSelectItem,
placeholder,
Expand Down Expand Up @@ -353,8 +361,8 @@ const ContentSearch = ({

return (
<StyledComponentContext cacheKey="tenup-component-content-search">
<NavigableMenu onNavigate={handleOnNavigate} orientation="vertical">
<SearchControl
<StyledNavigableMenu onNavigate={handleOnNavigate} orientation="vertical">
<StyledSearchControl
__next40pxDefaultSize
value={searchString}
onChange={(newSearchString) => {
Expand Down Expand Up @@ -444,7 +452,7 @@ const ContentSearch = ({
{isLoading && currentPage > 1 && <StyledSpinner />}
</>
) : null}
</NavigableMenu>
</StyledNavigableMenu>
</StyledComponentContext>
);
};
Expand Down

0 comments on commit 04c49b2

Please sign in to comment.