-
Notifications
You must be signed in to change notification settings - Fork 11.9k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[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 f99d5a1) * remove console.log --------- Co-authored-by: Ashley Harrison <ashley.harrison@grafana.com>
- Loading branch information
1 parent
9b33f96
commit b5d8a75
Showing
5 changed files
with
180 additions
and
15 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
32 changes: 32 additions & 0 deletions
32
packages/grafana-ui/src/components/EmptyState/GrotCTA/GrotCTA.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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', | ||
}, | ||
}), | ||
}; | ||
}; |
46 changes: 46 additions & 0 deletions
46
packages/grafana-ui/src/components/EmptyState/GrotCTA/grot-cta.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.