mirror of https://github.com/grafana/grafana
[v11.0.x] EmptyState: Add `call-to-action` variant (#86439)
* 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 component
(cherry picked from commit f99d5a1c1a
)
* remove console.log
---------
Co-authored-by: Ashley Harrison <ashley.harrison@grafana.com>
pull/86445/head
parent
9b33f9643c
commit
b5d8a753f9
@ -0,0 +1,32 @@ |
||||
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); |
||||
|
||||
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