File tree Expand file tree Collapse file tree 15 files changed +62
-55
lines changed Expand file tree Collapse file tree 15 files changed +62
-55
lines changed File renamed without changes.
Original file line number Diff line number Diff line change @@ -16,7 +16,7 @@ const Dashboard = () => {
16
16
< BasePageContainer >
17
17
< BasePageToolbar
18
18
title = { 'Dashboard' }
19
- actionsComponent = { DashboardActions }
19
+ actions = { < DashboardActions /> }
20
20
> </ BasePageToolbar >
21
21
< Grid container spacing = { 3 } >
22
22
< KeyMetrics />
Original file line number Diff line number Diff line change @@ -2,9 +2,9 @@ import React from 'react'
2
2
import Typography from '@material-ui/core/Typography'
3
3
import Link from '@material-ui/core/Link'
4
4
import { makeStyles } from '@material-ui/core/styles'
5
- // import pkg from '../../../package.json'
5
+ import pkg from '../../../package.json'
6
6
7
- const Footer = ( ) => {
7
+ const Footer : React . FC = ( ) => {
8
8
const classes = useStyles ( )
9
9
10
10
return (
@@ -15,7 +15,7 @@ const Footer = () => {
15
15
color = "secondary"
16
16
href = "https://github.com/modularcode/modular-admin-react/releases"
17
17
>
18
- { /* v{pkg.version} */ }
18
+ v{ pkg . version }
19
19
</ Link >
20
20
{ ' | ' }
21
21
< Link
File renamed without changes.
Original file line number Diff line number Diff line change 1
1
import React from 'react'
2
- import PropTypes from 'prop-types'
3
2
import clsx from 'clsx'
4
3
5
4
import { makeStyles } from '@material-ui/core/styles'
6
5
import AppBar from '@material-ui/core/AppBar'
7
6
import Toolbar from '@material-ui/core/Toolbar'
8
7
import IconButton from '@material-ui/core/IconButton'
9
-
10
8
import IconMenu from '@material-ui/icons/Menu'
11
9
12
- import HeaderDemo from './AppHeaderDemoButtons '
10
+ import { ITheme } from '_theme/ '
13
11
12
+ import HeaderDemo from './AppHeaderDemoButtons'
13
+ import HeaderProfile from './AppHeaderProfile'
14
14
// import HeaderSearch from './AppHeaderSearch'
15
15
// import HeaderNotifications from './AppHeaderNotifications'
16
- import HeaderProfile from './AppHeaderProfile'
17
16
18
- const AppHeader = ( { onToggleClick } ) => {
17
+ export interface IAppHeader {
18
+ onToggleClick ( ) : void
19
+ }
20
+
21
+ const AppHeader : React . FC < IAppHeader > = ( { onToggleClick } ) => {
19
22
const classes = useStyles ( )
20
23
21
24
return (
@@ -39,11 +42,7 @@ const AppHeader = ({ onToggleClick }) => {
39
42
)
40
43
}
41
44
42
- AppHeader . propTypes = {
43
- onToggleClick : PropTypes . func ,
44
- }
45
-
46
- const useStyles = makeStyles ( ( theme ) => ( {
45
+ const useStyles = makeStyles < ITheme > ( ( theme ) => ( {
47
46
header : {
48
47
background : '#fff' ,
49
48
color : '#7b7b7b' ,
Original file line number Diff line number Diff line change @@ -7,7 +7,9 @@ import IconCode from '@material-ui/icons/Code'
7
7
import IconStar from '@material-ui/icons/Star'
8
8
import IconDownload from '@material-ui/icons/GetApp'
9
9
10
- const AppHeaderDemoButtons = ( props ) => {
10
+ export interface IAppHeaderDemoButtonsProps { }
11
+
12
+ const AppHeaderDemoButtons : React . FC < IAppHeaderDemoButtonsProps > = ( props ) => {
11
13
const classes = useStyles ( props )
12
14
13
15
return (
Original file line number Diff line number Diff line change 1
- import React from 'react'
1
+ import React , { MouseEvent } from 'react'
2
2
3
3
import { makeStyles } from '@material-ui/core/styles'
4
4
import IconButton from '@material-ui/core/IconButton'
@@ -12,6 +12,8 @@ import ListItemAvatar from '@material-ui/core/ListItemAvatar'
12
12
import Avatar from '@material-ui/core/Avatar'
13
13
import Typography from '@material-ui/core/Typography'
14
14
15
+ import { ITheme } from '_theme/'
16
+
15
17
const notifications = [
16
18
{
17
19
user : {
@@ -39,16 +41,16 @@ const notifications = [
39
41
} ,
40
42
]
41
43
42
- const AppHeaderNotifications = ( ) => {
44
+ const AppHeaderNotifications : React . FC = ( ) => {
43
45
const classes = useStyles ( )
44
- const [ anchorEl , setAnchorEl ] = React . useState ( null )
46
+ const [ anchorEl , setAnchorEl ] = React . useState < HTMLButtonElement > ( )
45
47
46
- function handleClick ( event ) {
48
+ function handleClick ( event : MouseEvent < HTMLButtonElement > ) {
47
49
setAnchorEl ( event . currentTarget )
48
50
}
49
51
50
52
function handleClose ( ) {
51
- setAnchorEl ( null )
53
+ setAnchorEl ( undefined )
52
54
}
53
55
54
56
return (
@@ -120,7 +122,7 @@ const AppHeaderNotifications = () => {
120
122
// return <List className={classes.notifications}></List>
121
123
// }
122
124
123
- const useStyles = makeStyles ( ( theme ) => ( {
125
+ const useStyles = makeStyles < ITheme > ( ( theme ) => ( {
124
126
headerNotifications : {
125
127
marginRight : 23 ,
126
128
// position: 'relative',
Original file line number Diff line number Diff line change 1
- import React from 'react'
1
+ import React , { MouseEvent } from 'react'
2
2
import clsx from 'clsx'
3
3
4
4
import { Link } from 'react-router-dom'
@@ -18,9 +18,9 @@ import IconAccount from '@material-ui/icons/AccountBalance'
18
18
import IconSettings from '@material-ui/icons/Settings'
19
19
import IconLogout from '@material-ui/icons/ExitToApp'
20
20
21
- const AppHeaderProfile = ( ) => {
21
+ const AppHeaderProfile : React . FC = ( ) => {
22
22
const classes = useStyles ( )
23
- const [ anchorEl , setAnchorEl ] = React . useState ( null )
23
+ const [ anchorEl , setAnchorEl ] = React . useState < HTMLButtonElement > ( )
24
24
const user = {
25
25
firstName : 'Gevorg' ,
26
26
}
@@ -29,12 +29,12 @@ const AppHeaderProfile = () => {
29
29
return < div className = { clsx ( 'headerProfile' , classes . headerProfile ) } />
30
30
}
31
31
32
- function handleClick ( event ) {
32
+ function handleClick ( event : MouseEvent < HTMLButtonElement > ) {
33
33
setAnchorEl ( event . currentTarget )
34
34
}
35
35
36
36
function handleClose ( ) {
37
- setAnchorEl ( null )
37
+ setAnchorEl ( undefined )
38
38
}
39
39
40
40
return (
Original file line number Diff line number Diff line change @@ -11,7 +11,7 @@ import DialogTitle from '@material-ui/core/DialogTitle'
11
11
import IconSearch from '@material-ui/icons/Search'
12
12
import IconButton from '@material-ui/core/IconButton'
13
13
14
- const AppHeaderSearch = ( ) => {
14
+ const AppHeaderSearch : React . FC = ( ) => {
15
15
const classes = useStyles ( )
16
16
const [ open , setOpen ] = React . useState ( false )
17
17
File renamed without changes.
You can’t perform that action at this time.
0 commit comments