Skip to content

Commit

Permalink
Revisions to SideNav component migration
Browse files Browse the repository at this point in the history
Co-authored-by: Cole Bemis <colebemis@github.com>
  • Loading branch information
VanAnderson and colebemis committed Feb 10, 2021
1 parent 3fcdf25 commit 8746959
Showing 1 changed file with 4 additions and 6 deletions.
10 changes: 4 additions & 6 deletions src/SideNav.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,12 @@ import theme from './theme'
import sx, {SxProp} from './sx'
import * as History from 'history'

type StyledSideNavBaseProps = {
type SideNavBaseProps = {
variant?: 'lightweight' | 'normal'
bordered?: boolean
} & ComponentProps<typeof BorderBox>

function SideNavBase({variant, className, bordered, children, ...props}: StyledSideNavBaseProps) {
function SideNavBase({variant, className, bordered, children, ...props}: SideNavBaseProps) {
const variantClassName = variant === 'lightweight' ? 'lightweight' : 'normal'
const newClassName = classnames(className, `variant-${variantClassName}`)

Expand All @@ -30,7 +30,7 @@ function SideNavBase({variant, className, bordered, children, ...props}: StyledS
)
}

const SideNav = styled(SideNavBase)<StyledSideNavBaseProps>`
const SideNav = styled(SideNavBase)`
background-color: ${get('colors.white')};
${props =>
Expand All @@ -51,9 +51,7 @@ type StyledSideNavLinkProps = {
to?: History.LocationDescriptor
selected?: boolean
variant?: 'full' | 'normal'
} & SystemCommonProps &
SxProp &
SystemTypographyProps
}

const SideNavLink = styled(Link).attrs<StyledSideNavLinkProps>(props => {
const isReactRouter = typeof props.to === 'string'
Expand Down

0 comments on commit 8746959

Please sign in to comment.