Skip to content

Commit 459f147

Browse files
authored
fix: show search bar also in small screen view
Refs: SHELL-78 (#602)
1 parent 92c5a9a commit 459f147

File tree

1 file changed

+10
-12
lines changed

1 file changed

+10
-12
lines changed

src/shell/shell-header.tsx

Lines changed: 10 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -6,13 +6,7 @@
66

77
import React from 'react';
88

9-
import {
10-
Catcher,
11-
Container,
12-
Padding,
13-
Responsive,
14-
useScreenMode
15-
} from '@zextras/carbonio-design-system';
9+
import { Catcher, Container, Padding } from '@zextras/carbonio-design-system';
1610
import type { SearchBar as SearchUISearchBar } from '@zextras/carbonio-search-ui';
1711
import styled from 'styled-components';
1812

@@ -37,7 +31,6 @@ interface ShellHeaderProps {
3731
const ShellHeader = ({ children }: ShellHeaderProps): React.JSX.Element => {
3832
const { darkReaderStatus } = useDarkMode();
3933

40-
const screenMode = useScreenMode();
4134
const [SearchBar, isSearchBarAvailable] =
4235
useIntegratedComponent<typeof SearchUISearchBar>('search-bar');
4336
return (
@@ -51,7 +44,7 @@ const ShellHeader = ({ children }: ShellHeaderProps): React.JSX.Element => {
5144
maxHeight={HEADER_BAR_HEIGHT}
5245
mainAlignment="space-between"
5346
padding={{
54-
horizontal: screenMode === 'desktop' ? 'large' : 'extrasmall',
47+
horizontal: 'large',
5548
vertical: 'small'
5649
}}
5750
>
@@ -68,10 +61,15 @@ const ShellHeader = ({ children }: ShellHeaderProps): React.JSX.Element => {
6861
<Padding horizontal="large">
6962
<CreationButton />
7063
</Padding>
71-
<Responsive mode="desktop">{isSearchBarAvailable && <SearchBar />}</Responsive>
64+
{isSearchBarAvailable && <SearchBar />}
7265
</Container>
73-
<Container orientation="horizontal" width="auto" mainAlignment="flex-end">
74-
<Responsive mode="desktop">{children}</Responsive>
66+
<Container
67+
orientation="horizontal"
68+
width="auto"
69+
mainAlignment="flex-end"
70+
padding={{ left: 'small' }}
71+
>
72+
{children}
7573
</Container>
7674
</Catcher>
7775
</ShellHeaderContainer>

0 commit comments

Comments
 (0)