@@ -23,7 +23,7 @@ export default (componentName, localTheme, options = {}) => (ThemedComponent) =>
23
23
static propTypes = {
24
24
composeTheme : PropTypes . oneOf ( [ COMPOSE_DEEPLY , COMPOSE_SOFTLY , DONT_COMPOSE ] ) ,
25
25
theme : PropTypes . object ,
26
- namespace : PropTypes . string
26
+ themeNamespace : PropTypes . string
27
27
}
28
28
29
29
static defaultProps = {
@@ -40,14 +40,14 @@ export default (componentName, localTheme, options = {}) => (ThemedComponent) =>
40
40
}
41
41
42
42
getNamespacedTheme ( ) {
43
- const { namespace , theme } = this . props
44
- if ( ! namespace ) return theme
45
- if ( namespace && ! theme ) throw new Error ( 'Invalid namespace use in react-css-themr. ' +
46
- 'Namespace prop should be used only with theme prop.' )
43
+ const { themeNamespace , theme } = this . props
44
+ if ( ! themeNamespace ) return theme
45
+ if ( themeNamespace && ! theme ) throw new Error ( 'Invalid themeNamespace use in react-css-themr. ' +
46
+ 'themeNamespace prop should be used only with theme prop.' )
47
47
48
48
return Object . keys ( theme )
49
- . filter ( key => key . startsWith ( namespace ) )
50
- . reduce ( ( p , c ) => ( { ...p , [ removeNamespace ( c , namespace ) ] : theme [ c ] } ) , { } )
49
+ . filter ( key => key . startsWith ( themeNamespace ) )
50
+ . reduce ( ( p , c ) => ( { ...p , [ removeNamespace ( c , themeNamespace ) ] : theme [ c ] } ) , { } )
51
51
}
52
52
53
53
getThemeNotComposed ( ) {
@@ -114,7 +114,7 @@ function validateComposeOption(composeTheme) {
114
114
}
115
115
}
116
116
117
- function removeNamespace ( key , namespace ) {
118
- const capitilized = key . substr ( namespace . length )
117
+ function removeNamespace ( key , themeNamespace ) {
118
+ const capitilized = key . substr ( themeNamespace . length )
119
119
return capitilized . slice ( 0 , 1 ) . toLowerCase ( ) + capitilized . slice ( 1 )
120
120
}
0 commit comments