mirror of
https://github.com/grafana/grafana.git
synced 2025-02-25 18:55:37 -06:00
Navigation: Improve responsiveness of TopSearchBar
(#53777)
* remove some magic numbers + used grid for better responsiveness * remove old responsive styles
This commit is contained in:
parent
fa2e74cd6e
commit
7eab08364e
@ -11,18 +11,14 @@ export function TopSearchBar() {
|
|||||||
const styles = useStyles2(getStyles);
|
const styles = useStyles2(getStyles);
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div className={styles.searchBar}>
|
<div className={styles.container}>
|
||||||
<a className={styles.logo} href="/" title="Go to home">
|
<div className={styles.leftContent}>
|
||||||
<Icon name="grafana" size="xl" />
|
<a className={styles.logo} href="/" title="Go to home">
|
||||||
</a>
|
<Icon name="grafana" size="xl" />
|
||||||
|
</a>
|
||||||
|
</div>
|
||||||
<div className={styles.searchWrapper}>
|
<div className={styles.searchWrapper}>
|
||||||
<FilterInput
|
<FilterInput placeholder="Search grafana" value={''} onChange={() => {}} className={styles.searchInput} />
|
||||||
width={50}
|
|
||||||
placeholder="Search grafana"
|
|
||||||
value={''}
|
|
||||||
onChange={() => {}}
|
|
||||||
className={styles.searchInput}
|
|
||||||
/>
|
|
||||||
</div>
|
</div>
|
||||||
<div className={styles.actions}>
|
<div className={styles.actions}>
|
||||||
<Tooltip placement="bottom" content="Help menu (todo)">
|
<Tooltip placement="bottom" content="Help menu (todo)">
|
||||||
@ -62,14 +58,17 @@ export function ProfileMenu() {
|
|||||||
|
|
||||||
const getStyles = (theme: GrafanaTheme2) => {
|
const getStyles = (theme: GrafanaTheme2) => {
|
||||||
return {
|
return {
|
||||||
searchBar: css({
|
container: css({
|
||||||
height: TOP_BAR_LEVEL_HEIGHT,
|
height: TOP_BAR_LEVEL_HEIGHT,
|
||||||
display: 'flex',
|
display: 'grid',
|
||||||
|
gridTemplateColumns: '1fr 2fr 1fr',
|
||||||
padding: theme.spacing(0, 2),
|
padding: theme.spacing(0, 2),
|
||||||
alignItems: 'center',
|
alignItems: 'center',
|
||||||
justifyContent: 'space-between',
|
|
||||||
border: `1px solid ${theme.colors.border.weak}`,
|
border: `1px solid ${theme.colors.border.weak}`,
|
||||||
}),
|
}),
|
||||||
|
leftContent: css({
|
||||||
|
display: 'flex',
|
||||||
|
}),
|
||||||
logo: css({
|
logo: css({
|
||||||
display: 'flex',
|
display: 'flex',
|
||||||
}),
|
}),
|
||||||
@ -77,11 +76,8 @@ const getStyles = (theme: GrafanaTheme2) => {
|
|||||||
searchInput: css({}),
|
searchInput: css({}),
|
||||||
actions: css({
|
actions: css({
|
||||||
display: 'flex',
|
display: 'flex',
|
||||||
flexGrow: 0,
|
|
||||||
gap: theme.spacing(1),
|
gap: theme.spacing(1),
|
||||||
position: 'relative',
|
justifyContent: 'flex-end',
|
||||||
width: 25, // this and the left pos is to make search input perfectly centered
|
|
||||||
left: -83,
|
|
||||||
}),
|
}),
|
||||||
actionItem: css({
|
actionItem: css({
|
||||||
display: 'flex',
|
display: 'flex',
|
||||||
|
@ -99,5 +99,4 @@
|
|||||||
@import 'pages/errorpage';
|
@import 'pages/errorpage';
|
||||||
@import 'pages/explore';
|
@import 'pages/explore';
|
||||||
@import 'pages/plugins';
|
@import 'pages/plugins';
|
||||||
@import 'old_responsive';
|
|
||||||
@import 'components/view_states';
|
@import 'components/view_states';
|
||||||
|
@ -1,10 +0,0 @@
|
|||||||
// Media queries
|
|
||||||
// ---------------------
|
|
||||||
|
|
||||||
@include media-breakpoint-down(xs) {
|
|
||||||
input[type='text'],
|
|
||||||
input[type='number'],
|
|
||||||
textarea {
|
|
||||||
font-size: 16px;
|
|
||||||
}
|
|
||||||
}
|
|
Loading…
Reference in New Issue
Block a user