1
- import React , { FunctionComponent , useEffect , useState , ChangeEvent } from "react" ;
1
+ import React , { FunctionComponent , useEffect , useState , ChangeEvent , forwardRef } from "react" ;
2
2
3
3
import MaterialTable from "material-table" ;
4
4
import Edit from '@material-ui/icons/Edit' ;
@@ -24,6 +24,17 @@ import Avatar from "@material-ui/core/Avatar";
24
24
import { UserData , SaveUserBody } from '../API' ;
25
25
import DialogActions from '@material-ui/core/DialogActions' ;
26
26
import DialogTitle from '@material-ui/core/DialogTitle' ;
27
+
28
+ import Search from '@material-ui/icons/Search' ;
29
+ import Clear from '@material-ui/icons/Clear' ;
30
+ import FirstPage from '@material-ui/icons/FirstPage' ;
31
+ import LastPage from '@material-ui/icons/LastPage' ;
32
+ import ChevronLeft from '@material-ui/icons/ChevronLeft' ;
33
+ import ChevronRight from '@material-ui/icons/ChevronRight'
34
+ import ArrowDownward from '@material-ui/icons/ArrowDownward' ;
35
+ import Check from '@material-ui/icons/Check' ;
36
+
37
+
27
38
import {
28
39
SERVER_URL ,
29
40
getData ,
@@ -35,6 +46,19 @@ import {
35
46
import getTechSkills from '../helpers/getTechSkills' ;
36
47
import validationCheck from '../validations/formValidation' ;
37
48
49
+ // material table
50
+ const tableIcons = {
51
+ Search : forwardRef ( ( props : any , ref : any ) => < Search { ...props } ref = { ref } /> ) ,
52
+ Clear : forwardRef ( ( props : any , ref : any ) => < Clear { ...props } ref = { ref } /> ) ,
53
+ FirstPage : forwardRef ( ( props : any , ref : any ) => < FirstPage { ...props } ref = { ref } /> ) ,
54
+ LastPage : forwardRef ( ( props : any , ref : any ) => < LastPage { ...props } ref = { ref } /> ) ,
55
+ NextPage : forwardRef ( ( props : any , ref : any ) => < ChevronRight { ...props } ref = { ref } /> ) ,
56
+ PreviousPage : forwardRef ( ( props : any , ref : any ) => < ChevronLeft { ...props } ref = { ref } /> ) ,
57
+ Check : forwardRef ( ( props : any , ref : any ) => < Check { ...props } ref = { ref } /> ) ,
58
+ SortArrow : forwardRef ( ( props : any , ref : any ) => < ArrowDownward { ...props } ref = { ref } /> ) ,
59
+ ResetSearch : forwardRef ( ( props : any , ref : any ) => < Clear { ...props } ref = { ref } /> ) ,
60
+ }
61
+
38
62
// styling table using material styles
39
63
const useStyles = makeStyles ( ( theme ) => ( {
40
64
root : {
@@ -153,6 +177,7 @@ const AllUsers: FunctionComponent<any> = () => {
153
177
} ) ;
154
178
}
155
179
setAlertDialogOpen ( false ) ;
180
+ setDialogOpen ( false ) ;
156
181
}
157
182
158
183
// handler for opening alert dialog for deletion
@@ -190,6 +215,13 @@ const AllUsers: FunctionComponent<any> = () => {
190
215
} ) ;
191
216
}
192
217
}
218
+ setCheck1 ( false ) ;
219
+ setCheck2 ( false ) ;
220
+ setCheck3 ( false ) ;
221
+ setCheck4 ( false ) ;
222
+ setCheck5 ( false ) ;
223
+ setCheck6 ( false ) ;
224
+ setDialogOpen ( false ) ;
193
225
}
194
226
195
227
const handleProfileChange = async ( e : ChangeEvent < HTMLInputElement > ) => {
@@ -453,6 +485,7 @@ const AllUsers: FunctionComponent<any> = () => {
453
485
< div className = { classes . root } >
454
486
< div className = { classes . subdiv } >
455
487
< MaterialTable
488
+ icons = { tableIcons }
456
489
title = "List of Users"
457
490
columns = { [
458
491
{
0 commit comments