mirror of https://github.com/grafana/grafana
EmptyState: Add `call-to-action` variant (#85017)
* add default variant * enhance story * rename to "initial" + update docs * default to showing a CTA * use switch * translations * update and use LinkButton * update default message * rename "initial" to "nothing-here" * update variant name to `call-to-action` * i18n * add CTA svg * extract into its own componentpull/86440/head
parent
93c24403b3
commit
f99d5a1c1a
@ -0,0 +1,33 @@ |
|||||||
|
import { css } from '@emotion/css'; |
||||||
|
import React, { SVGProps } from 'react'; |
||||||
|
import SVG from 'react-inlinesvg'; |
||||||
|
|
||||||
|
import { GrafanaTheme2 } from '@grafana/data'; |
||||||
|
|
||||||
|
import { useStyles2 } from '../../../themes'; |
||||||
|
|
||||||
|
import grotCTASvg from './grot-cta.svg'; |
||||||
|
|
||||||
|
export interface Props { |
||||||
|
width?: SVGProps<SVGElement>['width']; |
||||||
|
height?: SVGProps<SVGElement>['height']; |
||||||
|
} |
||||||
|
|
||||||
|
export const GrotCTA = ({ width = 'auto', height }: Props) => { |
||||||
|
const styles = useStyles2(getStyles); |
||||||
|
console.log(styles); |
||||||
|
|
||||||
|
return <SVG src={grotCTASvg} className={styles.svg} height={height} width={width} />; |
||||||
|
}; |
||||||
|
|
||||||
|
GrotCTA.displayName = 'GrotCTA'; |
||||||
|
|
||||||
|
const getStyles = (theme: GrafanaTheme2) => { |
||||||
|
return { |
||||||
|
svg: css({ |
||||||
|
'#grot-cta-cactus-1, #grot-cta-cactus-2': { |
||||||
|
fill: theme.isDark ? '#58558c' : '#c9c5f4', |
||||||
|
}, |
||||||
|
}), |
||||||
|
}; |
||||||
|
}; |
||||||
|
After Width: | Height: | Size: 785 KiB |
Loading…
Reference in new issue