Why Gemfury? Push, build, and install  RubyGems npm packages Python packages Maven artifacts PHP packages Go Modules Debian packages RPM packages NuGet packages

Repository URL to install this package:

Details    
@skava/ui / src / components / features / SkipNav / SkipNav.tsx
Size: Mime:
import React from 'react'
import { SkipNavAnchorLink } from './styled'
import { SkipNavProps } from './typings'

/**
 * @todo @see README.md
 */
const Portal = (props: SkipNavProps) => props.children

class SkipNav extends React.PureComponent<SkipNavProps> {
  static defaultProps = {
    to: 'main',
    identifier: 'skipnav',
  }
  render() {
    const identifier = this.props.identifier
    const to = '#' + this.props.to

    // tabIndex={}
    return (
      <Portal id={identifier}>
        <SkipNavAnchorLink href={to}>Skip to main content</SkipNavAnchorLink>
      </Portal>
    )
  }
}

export { SkipNav }
export default SkipNav