Skip to content

Commit

Permalink
fix(react): fix searchbar width issue in small screen (#2856)
Browse files Browse the repository at this point in the history
  • Loading branch information
topwebtek7 authored Jul 9, 2021
1 parent 5cbbebe commit 0e36df4
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 3 deletions.
1 change: 1 addition & 0 deletions datahub-web-react/src/app/home/HomePageHeader.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,7 @@ const HeaderContainer = styled.div`
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
`;

const NavGroup = styled.div`
Expand Down
13 changes: 10 additions & 3 deletions datahub-web-react/src/app/search/SearchBar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,14 @@ const ExploreForEntity = styled.span`
`;

const StyledAutoComplete = styled(AutoComplete)`
width: 650px;
width: 100%;
max-width: 800px;
`;

const AutoCompleteContainer = styled.div`
width: 100%;
text-align: center;
padding: 0 30px;
`;

const renderItem = (suggestion: string, icon: JSX.Element, type: string) => ({
Expand Down Expand Up @@ -90,7 +97,7 @@ export const SearchBar = ({
}));

return (
<div style={style}>
<AutoCompleteContainer style={style}>
<StyledAutoComplete
style={autoCompleteStyle}
options={options}
Expand All @@ -109,7 +116,7 @@ export const SearchBar = ({
data-testid="search-input"
/>
</StyledAutoComplete>
</div>
</AutoCompleteContainer>
);
};

Expand Down
1 change: 1 addition & 0 deletions datahub-web-react/src/app/search/SearchHeader.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@ const NavGroup = styled.div`
display: flex;
align-items: center;
justify-content: center;
min-width: 200px;
`;

/**
Expand Down

0 comments on commit 0e36df4

Please sign in to comment.