Repository URL to install this package:
|
Version:
0.9.5 ▾
|
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