File tree Expand file tree Collapse file tree 2 files changed +58
-0
lines changed Expand file tree Collapse file tree 2 files changed +58
-0
lines changed Original file line number Diff line number Diff line change
1
+ import React from 'react' ;
2
+ import { useStore } from 'store' ;
3
+ import AlertContainer from 'components/common/AlertContainer' ;
4
+ import { Button } from 'components/common/base' ;
5
+
6
+ export default {
7
+ title : 'Components/Alerts' ,
8
+ component : AlertContainer ,
9
+ parameters : { centered : true } ,
10
+ } ;
11
+
12
+ export const Default = ( ) => {
13
+ const store = useStore ( ) ;
14
+ const handleClick = ( ) => {
15
+ store . uiStore . notify (
16
+ 'This is a sample message to be displayed inside of a toast alert' ,
17
+ 'Sample Alert Title' ,
18
+ ) ;
19
+ } ;
20
+
21
+ return (
22
+ < >
23
+ < Button onClick = { handleClick } > Show Alert</ Button >
24
+ < AlertContainer />
25
+ </ >
26
+ ) ;
27
+ } ;
Original file line number Diff line number Diff line change
1
+ import React from 'react' ;
2
+ import Tip from 'components/common/Tip' ;
3
+
4
+ export default {
5
+ title : 'Components/Tooltip' ,
6
+ component : Tip ,
7
+ parameters : { contained : true } ,
8
+ } ;
9
+
10
+ const placements = [
11
+ 'top' ,
12
+ 'topRight' ,
13
+ 'right' ,
14
+ 'bottomRight' ,
15
+ 'bottom' ,
16
+ 'bottomLeft' ,
17
+ 'left' ,
18
+ 'topLeft' ,
19
+ ] ;
20
+
21
+ export const Placements = ( ) => {
22
+ return (
23
+ < div style = { { textAlign : 'center' , marginTop : 300 } } >
24
+ { placements . map ( p => (
25
+ < Tip key = { p } placement = { p } overlay = "Tip of the day" >
26
+ < span style = { { margin : 10 } } > { p } </ span >
27
+ </ Tip >
28
+ ) ) }
29
+ </ div >
30
+ ) ;
31
+ } ;
You can’t perform that action at this time.
0 commit comments