From e3732f65bf953e444f59f3b2ff5c47c0590f5db8 Mon Sep 17 00:00:00 2001 From: Van Anderson Date: Fri, 5 Feb 2021 10:35:43 -0600 Subject: [PATCH] Reorganize Header component file --- src/Header.tsx | 40 +++++++++++++++++++++------------------- 1 file changed, 21 insertions(+), 19 deletions(-) diff --git a/src/Header.tsx b/src/Header.tsx index 516fbf9f152..ab8e359cc58 100644 --- a/src/Header.tsx +++ b/src/Header.tsx @@ -40,18 +40,8 @@ const HeaderItem = styled.div` ${BORDER}; ${sx}; ` -HeaderItem.displayName = 'Header.Item' - -HeaderItem.defaultProps = { - theme -} -HeaderItem.propTypes = { - full: PropTypes.bool, - ...COMMON.propTypes, - ...BORDER.propTypes, - ...sx.propTypes -} +HeaderItem.displayName = 'Header.Item' const HeaderLink = styled.a.attrs(({to}: StyledHeaderLinkProps) => { const isReactRouter = typeof to === 'string' @@ -81,9 +71,27 @@ const HeaderLink = styled.a.attrs(({to}: StyledHeaderLinkProps) => { ${TYPOGRAPHY}; ${sx}; ` + HeaderLink.displayName = 'Header.Link' -HeaderLink.defaultProps = { +Header.propTypes = { + ...sx.propTypes, + ...COMMON.propTypes, + ...BORDER.propTypes +} + +Header.defaultProps = { + theme +} + +HeaderItem.propTypes = { + full: PropTypes.bool, + ...COMMON.propTypes, + ...BORDER.propTypes, + ...sx.propTypes +} + +HeaderItem.defaultProps = { theme } @@ -96,13 +104,7 @@ HeaderLink.propTypes = { ...sx.propTypes } -Header.propTypes = { - ...sx.propTypes, - ...COMMON.propTypes, - ...BORDER.propTypes -} - -Header.defaultProps = { +HeaderLink.defaultProps = { theme }