-
Notifications
You must be signed in to change notification settings - Fork 357
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
- Loading branch information
1 parent
2f0464f
commit 30e3393
Showing
2 changed files
with
61 additions
and
4 deletions.
There are no files selected for viewing
51 changes: 51 additions & 0 deletions
51
webui/react/src/shared/components/ActionDropdown/ActionDropdown.stories.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,51 @@ | ||
import React from 'react'; | ||
|
||
import ActionDropdown from './ActionDropdown'; | ||
|
||
export default { | ||
component: ActionDropdown, | ||
title: 'ActionDropdown', | ||
}; | ||
|
||
const FIRST_ACTION = 'First Action'; | ||
const SECOND_ACTION = 'Second Action'; | ||
const THIRD_ACTION = 'Third Action'; | ||
|
||
const actions = [ | ||
FIRST_ACTION, | ||
SECOND_ACTION, | ||
THIRD_ACTION, | ||
]; | ||
|
||
const disabled = { | ||
[FIRST_ACTION]: false, | ||
[SECOND_ACTION]: true, | ||
[THIRD_ACTION]: false, | ||
}; | ||
|
||
const triggers = { | ||
[FIRST_ACTION]: () => { return; }, | ||
[SECOND_ACTION]: () => { return; }, | ||
[THIRD_ACTION]: () => { return; }, | ||
}; | ||
|
||
export const Default = (): React.ReactNode => ( | ||
<ActionDropdown | ||
actionOrder={actions} | ||
id="id" | ||
kind="kind" | ||
onError={() => { return; }} | ||
onTrigger={triggers} | ||
/> | ||
); | ||
|
||
export const DisabledAction = (): React.ReactNode => ( | ||
<ActionDropdown | ||
actionOrder={actions} | ||
disabled={disabled} | ||
id="id" | ||
kind="kind" | ||
onError={() => { return; }} | ||
onTrigger={triggers} | ||
/> | ||
); |
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