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
12668392
Unverified
Commit
12668392
authored
Sep 11, 2020
by
Alex Khomenko
Committed by
GitHub
Sep 11, 2020
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Grafana-UI: Expand ConfirmModal docs (#27541)
parent
1983de96
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
22 additions
and
0 deletions
+22
-0
packages/grafana-ui/src/components/ConfirmModal/ConfirmModal.mdx
+14
-0
packages/grafana-ui/src/components/ConfirmModal/ConfirmModal.tsx
+8
-0
No files found.
packages/grafana-ui/src/components/ConfirmModal/ConfirmModal.mdx
View file @
12668392
...
@@ -7,4 +7,18 @@ import { ConfirmModal } from './ConfirmModal';
...
@@ -7,4 +7,18 @@ import { ConfirmModal } from './ConfirmModal';
Used to request user for action confirmation, e.g. deleting items. Triggers provided 'onConfirm' callback.
Used to request user for action confirmation, e.g. deleting items. Triggers provided 'onConfirm' callback.
# Usage
```jsx
<ConfirmModal
isOpen={false}
title='Delete user'
body='Are you sure you want to delete this user?'
confirmText='Confirm'
icon='exclamation-triangle'
onConfirm={() => console.log('Confirm action')}
onDismiss={() => console.log('Dismiss action')}
/>
```
<Props of={ConfirmModal} />
<Props of={ConfirmModal} />
packages/grafana-ui/src/components/ConfirmModal/ConfirmModal.tsx
View file @
12668392
...
@@ -8,13 +8,21 @@ import { GrafanaTheme } from '@grafana/data';
...
@@ -8,13 +8,21 @@ import { GrafanaTheme } from '@grafana/data';
import
{
HorizontalGroup
}
from
'..'
;
import
{
HorizontalGroup
}
from
'..'
;
export
interface
Props
{
export
interface
Props
{
/** Toggle modal's open/closed state */
isOpen
:
boolean
;
isOpen
:
boolean
;
/** Title for the modal header */
title
:
string
;
title
:
string
;
/** Modal content */
body
:
React
.
ReactNode
;
body
:
React
.
ReactNode
;
/** Text for confirm button */
confirmText
:
string
;
confirmText
:
string
;
/** Text for dismiss button */
dismissText
?:
string
;
dismissText
?:
string
;
/** Icon for the modal header */
icon
?:
IconName
;
icon
?:
IconName
;
/** Confirm action callback */
onConfirm
():
void
;
onConfirm
():
void
;
/** Dismiss action callback */
onDismiss
():
void
;
onDismiss
():
void
;
}
}
...
...
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