@@ -12,6 +12,21 @@ import {
12
12
makeStyles as materialMakeStyles ,
13
13
} from '@material-ui/styles'
14
14
15
+ export function useTheme < Theme = CommittedTheme > ( ) {
16
+ return materialUseTheme < Theme > ( )
17
+ }
18
+
19
+ /**
20
+ * `makeStyles` where the passed `styles` do not depend on props
21
+ */
22
+ export function makeStyles <
23
+ Theme = CommittedTheme ,
24
+ ClassKey extends string = string
25
+ > (
26
+ style : Styles < Theme , { } , ClassKey > ,
27
+ options ?: Omit < WithStylesOptions < Theme > , 'withTheme' >
28
+ ) : ( props ?: any ) => ClassNameMap < ClassKey >
29
+
15
30
/**
16
31
* `makeStyles` where the passed `styles` do depend on props
17
32
*/
@@ -25,18 +40,17 @@ export function makeStyles<
25
40
) : ( props : Props ) => ClassNameMap < ClassKey >
26
41
27
42
/**
28
- * `makeStyles` where the passed `styles` do not depend on props
43
+ * `makeStyles` where the passed `styles` do depend on props
29
44
*/
30
45
export function makeStyles <
31
46
Theme = CommittedTheme ,
47
+ Props extends { } = { } ,
32
48
ClassKey extends string = string
33
49
> (
34
- style : Styles < Theme , { } , ClassKey > ,
50
+ styles : Styles < Theme , Props , ClassKey > ,
35
51
options ?: Omit < WithStylesOptions < Theme > , 'withTheme' >
36
- ) : ( props ?: any ) => ClassNameMap < ClassKey > {
37
- return materialMakeStyles < Theme , { } , ClassKey > ( style , options )
38
- }
39
-
40
- export function useTheme < Theme = CommittedTheme > ( ) {
41
- return materialUseTheme < Theme > ( )
52
+ ) :
53
+ | ( ( props : Props ) => ClassNameMap < ClassKey > )
54
+ | ( ( props ?: Props ) => ClassNameMap < ClassKey > ) {
55
+ return materialMakeStyles < Theme , Props , ClassKey > ( styles , options )
42
56
}
0 commit comments