Skip to content

Commit 996d433

Browse files
committed
Merge branch 'master' of github.com:emortlock/tailwind-react
2 parents d180d05 + cdc7c8b commit 996d433

File tree

3 files changed

+11
-2
lines changed

3 files changed

+11
-2
lines changed

src/header/NavBrand.jsx

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,13 +5,14 @@ import { withTheme } from '../theme'
55
import { BaseComponent } from '../tailwind'
66
import { filterProps } from '../utils'
77

8-
const NavBrand = ({ theme, is, children, ...rest }) => (
8+
const NavBrand = ({ theme, header: { style }, is, children, ...rest }) => (
99
<BaseComponent
1010
flex={[true, 'no-shrink']}
1111
items="center"
1212
h={12}
1313
is={is}
1414
m={{ r: theme.spacing.lg }}
15+
text={style.text}
1516
{...filterProps(rest, ['header'])}
1617
>
1718
{children}
@@ -22,11 +23,15 @@ NavBrand.propTypes = {
2223
theme: PropTypes.shape({}).isRequired,
2324
is: PropTypes.oneOfType([PropTypes.string, PropTypes.func, PropTypes.object]),
2425
children: PropTypes.node,
26+
header: PropTypes.shape({
27+
style: PropTypes.object.isRequired,
28+
}),
2529
}
2630

2731
NavBrand.defaultProps = {
2832
is: 'div',
2933
children: undefined,
34+
header: {},
3035
}
3136

3237
export { NavBrand as component }

src/header/__tests__/NavBrand.jsx

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,10 @@ import { component as NavBrand } from '../NavBrand'
55
import { defaultTheme } from '../../theme'
66

77
const setup = (testProps = {}) => {
8-
const props = Object.assign({ theme: defaultTheme }, testProps)
8+
const props = Object.assign(
9+
{ theme: defaultTheme, header: { style: { text: 'white' } } },
10+
testProps,
11+
)
912

1013
const wrapper = shallow(<NavBrand {...props}>Tailwind React</NavBrand>)
1114

src/header/__tests__/__snapshots__/NavBrand.jsx.snap

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ exports[`NavBrand renders matching snapshot 1`] = `
1616
"r": 8,
1717
}
1818
}
19+
text="white"
1920
>
2021
Tailwind React
2122
</BaseComponent>

0 commit comments

Comments
 (0)