Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
N
nexpie-grafana-theme
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Registry
Registry
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Kornkitt Poolsup
nexpie-grafana-theme
Commits
fa64d7ec
Unverified
Commit
fa64d7ec
authored
Dec 03, 2020
by
Torkel Ödegaard
Committed by
GitHub
Dec 03, 2020
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Alert: Fix forwardRef warning (#29577)
parent
b63e6959
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
4 deletions
+4
-4
packages/grafana-ui/src/components/Alert/Alert.tsx
+4
-4
No files found.
packages/grafana-ui/src/components/Alert/Alert.tsx
View file @
fa64d7ec
...
...
@@ -9,7 +9,7 @@ import { getColorsFromSeverity } from '../../utils/colors';
export
type
AlertVariant
=
'success'
|
'warning'
|
'error'
|
'info'
;
export
interface
Props
extends
HTMLAttributes
<
HTMLElement
>
{
export
interface
Props
extends
HTMLAttributes
<
HTML
Div
Element
>
{
title
:
string
;
/** On click handler for alert button, mostly used for dismissing the alert */
onRemove
?:
(
event
:
React
.
MouseEvent
)
=>
void
;
...
...
@@ -39,13 +39,13 @@ function getIconFromSeverity(severity: AlertVariant): string {
}
}
export
const
Alert
:
FC
<
Props
>
=
React
.
forwardRef
<
HTMLElement
,
Props
>
(
({
title
,
buttonText
,
onButtonClick
,
onRemove
,
children
,
buttonContent
,
severity
=
'error'
,
...
restProps
})
=>
{
export
const
Alert
:
FC
<
Props
>
=
React
.
forwardRef
<
HTML
Div
Element
,
Props
>
(
({
title
,
buttonText
,
onButtonClick
,
onRemove
,
children
,
buttonContent
,
severity
=
'error'
,
...
restProps
}
,
ref
)
=>
{
const
theme
=
useTheme
();
const
styles
=
getStyles
(
theme
,
severity
,
!!
buttonContent
);
return
(
<
div
className=
{
styles
.
alert
}
aria
-
label=
{
selectors
.
components
.
Alert
.
alert
(
severity
)
}
{
...
restProps
}
>
<
div
ref=
{
ref
}
className=
{
styles
.
alert
}
aria
-
label=
{
selectors
.
components
.
Alert
.
alert
(
severity
)
}
{
...
restProps
}
>
<
div
className=
{
styles
.
icon
}
>
<
Icon
size=
"xl"
name=
{
getIconFromSeverity
(
severity
)
as
IconName
}
/>
</
div
>
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment