mirror of https://github.com/grafana/grafana
TopNav: Make dashboard toolbar actions work in new top nav (#51950)
* Initial work on new toolbar button * Minor step * Small progress * Minor progress * Minor fix * removed console.log * Removing stuff we don't need yetpull/52271/head
parent
ecdd4a184f
commit
7947629f82
@ -0,0 +1,38 @@ |
||||
import { css } from '@emotion/css'; |
||||
import React from 'react'; |
||||
|
||||
import { GrafanaTheme2 } from '@grafana/data'; |
||||
import { config } from '@grafana/runtime'; |
||||
import { useStyles2 } from '@grafana/ui'; |
||||
|
||||
export interface Props { |
||||
leftActionsSeparator?: boolean; |
||||
} |
||||
|
||||
export function NavToolbarSeparator({ leftActionsSeparator }: Props) { |
||||
const styles = useStyles2(getStyles); |
||||
|
||||
if (leftActionsSeparator) { |
||||
return <div className={styles.leftActionsSeparator} />; |
||||
} |
||||
|
||||
if (config.featureToggles.topnav) { |
||||
return <div className={styles.line} />; |
||||
} |
||||
|
||||
return null; |
||||
} |
||||
|
||||
const getStyles = (theme: GrafanaTheme2) => { |
||||
return { |
||||
leftActionsSeparator: css({ |
||||
display: 'flex', |
||||
flexGrow: 1, |
||||
}), |
||||
line: css({ |
||||
width: 1, |
||||
backgroundColor: theme.colors.border.medium, |
||||
height: 24, |
||||
}), |
||||
}; |
||||
}; |
Loading…
Reference in new issue