Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(react): fix searchbar width issue in small screen #2856

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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