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    
Size: Mime:
import React from 'react'
import { styled } from 'view-container'
import { BackToTopParent } from './styled'
import BreedBase from './breed/base'
import WithIcon from './breed/WithIcon'
import { Props } from './typings'

class BackToTop extends React.Component<Props> {
  static defaultProps = {
    breedType: 'with-icon',
  }
  render() {
    const { breedType } = this.props
    // required some code short here since we are using same parent
    let newVal
    switch (breedType) {
      case 'base':
        newVal = <BreedBase />
        break
      case 'with-icon':
        newVal = <WithIcon />
        break
      default:
        break
    }
    return <BackToTopParent>{newVal}</BackToTopParent>
  }
}

export { BackToTop }
export default BackToTop