Skip to content

Commit 117ae57

Browse files
v-tarasevich-blitz-brainv-tarasevichchriscollins3456
authored
feat(UI): make searchbar centered and wider (#12666)
Co-authored-by: Victor Tarasevich <[email protected]> Co-authored-by: Chris Collins <[email protected]>
1 parent 5790b84 commit 117ae57

File tree

2 files changed

+27
-10
lines changed

2 files changed

+27
-10
lines changed

datahub-web-react/src/app/searchV2/SearchBar.tsx

+2-2
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ import { useAppConfig, useIsShowSeparateSiblingsEnabled } from '../useAppConfig'
3131

3232
const StyledAutoComplete = styled(AutoComplete)<{ $isShowNavBarRedesign?: boolean }>`
3333
width: 100%;
34-
max-width: ${(props) => (props.$isShowNavBarRedesign ? '423px' : '540px')};
34+
max-width: ${(props) => (props.$isShowNavBarRedesign ? '632px' : '540px')};
3535
`;
3636

3737
const SkeletonContainer = styled.div`
@@ -466,7 +466,7 @@ export const SearchBar = ({
466466
maxHeight: 1000,
467467
overflowY: 'visible',
468468
position: (fixAutoComplete && 'fixed') || 'relative',
469-
...(isShowNavBarRedesign ? { minWidth: '435px' } : {}),
469+
...(isShowNavBarRedesign ? { minWidth: '648px' } : {}),
470470
}}
471471
onDropdownVisibleChange={(isOpen) => {
472472
if (!isOpen) {

datahub-web-react/src/app/searchV2/SearchHeader.tsx

+25-8
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ const getStyles = ($isShowNavBarRedesign?: boolean) => {
2727
padding: 0,
2828
display: 'flex',
2929
justifyContent: 'center',
30-
width: $isShowNavBarRedesign ? '439px' : '620px',
30+
width: $isShowNavBarRedesign ? '648px' : '620px',
3131
minWidth: '400px',
3232
},
3333
};
@@ -48,17 +48,25 @@ const Header = styled(Layout)<{ $isNavBarCollapsed?: boolean; $isShowNavBarRedes
4848
background-color: transparent;
4949
height: ${(props) => (props.$isShowNavBarRedesign ? '56px' : '72px')};
5050
display: flex;
51-
${(props) => {
52-
if (!props.$isShowNavBarRedesign) return '';
53-
return `padding-left: ${props.$isNavBarCollapsed ? '68px;' : '270px'};`;
54-
}}
5551
${(props) =>
5652
props.$isShowNavBarRedesign &&
5753
`
5854
margin-top: 8px;
5955
gap: 16px;
6056
flex-direction: row;
61-
transition: padding 250ms ease-in-out;
57+
58+
// preventing of NavBar's overlapping
59+
position: relative;
60+
padding-left: ${props.$isNavBarCollapsed ? '224px' : '540px'};
61+
left: ${props.$isNavBarCollapsed ? '-112px' : '-270px'};
62+
transition: none;
63+
@media only screen and (min-width: 1280px) {
64+
padding-left: 540px;
65+
left: -270px;
66+
}
67+
@media only screen and (max-width: 1200px) {
68+
transition: padding 250ms ease-in-out;
69+
}
6270
`}
6371
${(props) => props.$isShowNavBarRedesign && !props.$isNavBarCollapsed && 'justify-content: space-between;'}
6472
align-items: center;
@@ -76,10 +84,10 @@ const SearchBarContainer = styled.div<{ $isShowNavBarRedesign?: boolean }>`
7684
display: flex;
7785
flex: 1;
7886
align-items: center;
87+
justify-content: center;
7988
${(props) =>
8089
!props.$isShowNavBarRedesign &&
8190
`
82-
justify-content: center;
8391
margin-left: 80px;
8492
margin-top: 6px;
8593
`}
@@ -106,6 +114,11 @@ const StyledButton = styled(Button)`
106114
}
107115
`;
108116

117+
const NavBarTogglerWrapper = styled.div`
118+
position: fixed;
119+
left: 68px;
120+
`;
121+
109122
type Props = {
110123
initialQuery: string;
111124
placeholderText: string;
@@ -140,7 +153,11 @@ export const SearchHeader = ({
140153
<HeaderBackground $isShowNavBarRedesign={isShowNavBarRedesign} />
141154
<Wrapper $isShowNavBarRedesign={isShowNavBarRedesign}>
142155
<Header $isShowNavBarRedesign={isShowNavBarRedesign} $isNavBarCollapsed={isCollapsed}>
143-
{isShowNavBarRedesign && isCollapsed && <NavBarToggler />}
156+
{isShowNavBarRedesign && isCollapsed && (
157+
<NavBarTogglerWrapper>
158+
<NavBarToggler />
159+
</NavBarTogglerWrapper>
160+
)}
144161
<SearchBarContainer $isShowNavBarRedesign={isShowNavBarRedesign}>
145162
<SearchBar
146163
isLoading={isUserInitializing || !appConfig.loaded}

0 commit comments

Comments
 (0)