This commit is contained in:
mgabdev
2020-04-23 02:13:29 -04:00
parent fed036be08
commit e2e7e8c0af
177 changed files with 1231 additions and 1326 deletions

View File

@@ -1,11 +1,21 @@
import { NavLink } from 'react-router-dom'
import Text from './text'
/**
* Renders a user stat component
* @param {string} props.title - bottom title
* @param {string} props.to - location to go to on click
* @param {string} props.value - top value
*/
export default class UserStat extends PureComponent {
static propTypes = {
to: PropTypes.string,
title: PropTypes.string,
value: PropTypes.string,
title: PropTypes.string.isRequired,
to: PropTypes.string.isRequired,
value: PropTypes.oneOfType([
PropTypes.string,
PropTypes.object,
]).isRequired,
}
state = {
@@ -29,16 +39,17 @@ export default class UserStat extends PureComponent {
to={to}
title={`${value} ${title}`}
className={[_s.default, _s.flexGrow1, _s.cursorPointer, _s.noUnderline, _s.pr15].join(' ')}
onMouseEnter={() => this.handleOnMouseEnter()}
onMouseLeave={() => this.handleOnMouseLeave()}
onMouseEnter={this.handleOnMouseEnter}
onMouseLeave={this.handleOnMouseLeave}
>
<Text size='large' weight='bold' color='brand'>
{value}
</Text>
<Text size='small' weight='medium' color='secondary' underline={hovering}>
<Text size='small' weight='medium' color='secondary' hasUnderline={hovering}>
{title}
</Text>
</NavLink>
)
}
}