1
1
import React , { useState } from 'react' ;
2
2
import { FlexCell , MultiSwitch , Text } from '@epam/uui' ;
3
+
4
+ import { ReactComponent as TableIcon } from '@epam/assets/icons/content-view_table-outline.svg' ;
5
+ import { ReactComponent as GridIcon } from '@epam/assets/icons/content-view_grid-fill.svg' ;
6
+ import { ReactComponent as DetailsIcon } from '@epam/assets/icons/content-view_detailes-fill.svg' ;
7
+ import { ReactComponent as StarIcon } from '@epam/assets/icons/communication-star-fill.svg' ;
8
+ import { ReactComponent as ClockIcon } from '@epam/assets/icons/action-schedule-outline.svg' ;
9
+ import { ReactComponent as ChatIcon } from '@epam/assets/icons/communication-chat-outline.svg' ;
10
+
3
11
import css from './BasicExample.module.scss' ;
4
12
5
13
export default function BasicExample ( ) {
6
- const [ value , onValueChange ] = useState ( null ) ;
14
+ const [ value , onValueChange ] = useState ( 'on' ) ;
15
+ const [ userType , userTypeOnValueChange ] = useState ( ) ;
16
+ const [ view , setView ] = useState ( 1 ) ;
17
+ const [ filter , setFilter ] = useState ( 2 ) ;
7
18
8
19
return (
9
20
< FlexCell width = "auto" cx = { css . container } >
@@ -18,8 +29,8 @@ export default function BasicExample() {
18
29
items = { [
19
30
{ id : 1 , caption : 'Mentee' } , { id : 2 , caption : 'Mentor' } , { id : 3 , caption : 'Coordinator' } ,
20
31
] }
21
- value = { value }
22
- onValueChange = { onValueChange }
32
+ value = { userType }
33
+ onValueChange = { userTypeOnValueChange }
23
34
/>
24
35
< Text > With Grey border</ Text >
25
36
< MultiSwitch
@@ -28,18 +39,34 @@ export default function BasicExample() {
28
39
{ id : 1 , caption : 'Mentee' } , { id : 2 , caption : 'Mentor' } , { id : 3 , caption : 'Coordinator' } ,
29
40
] }
30
41
color = "secondary"
31
- value = { value }
32
- onValueChange = { onValueChange }
42
+ value = { userType }
43
+ onValueChange = { userTypeOnValueChange }
33
44
/>
34
45
< Text > Disabled</ Text >
35
46
< MultiSwitch
36
47
items = { [
37
48
{ id : 1 , caption : 'Mentee' } , { id : 2 , caption : 'Mentor' } , { id : 3 , caption : 'Coordinator' } ,
38
49
] }
39
- value = { value }
40
- onValueChange = { onValueChange }
50
+ value = { userType }
51
+ onValueChange = { userTypeOnValueChange }
41
52
isDisabled
42
53
/>
54
+ < Text > Icon only</ Text >
55
+ < MultiSwitch
56
+ items = { [
57
+ { id : 1 , icon : TableIcon } , { id : 2 , icon : GridIcon } , { id : 3 , icon : DetailsIcon } ,
58
+ ] }
59
+ value = { view }
60
+ onValueChange = { setView }
61
+ />
62
+ < Text > Icon + Label</ Text >
63
+ < MultiSwitch
64
+ items = { [
65
+ { id : 1 , icon : StarIcon , caption : 'Starred' } , { id : 2 , icon : ClockIcon , caption : 'Latest' } , { id : 3 , icon : ChatIcon , caption : 'All chats' } ,
66
+ ] }
67
+ value = { filter }
68
+ onValueChange = { setFilter }
69
+ />
43
70
</ FlexCell >
44
71
) ;
45
72
}
0 commit comments