mirror of
https://github.com/haiwen/seahub.git
synced 2025-09-13 22:01:06 +00:00
* 01 fix eslint warnings * fix code warnings * fix code warnings * fix code warnings * fix code warnings * fix code warnings
21 lines
489 B
JavaScript
21 lines
489 B
JavaScript
import React, { Component } from 'react';
|
|
import PropTypes from 'prop-types';
|
|
import { Link } from '@gatsbyjs/reach-router';
|
|
import { siteRoot } from '../../utils/constants';
|
|
|
|
const propTypes = {
|
|
email: PropTypes.string,
|
|
name: PropTypes.string.isRequired
|
|
};
|
|
|
|
class UserLink extends Component {
|
|
|
|
render() {
|
|
return <Link to={`${siteRoot}sys/users/${encodeURIComponent(this.props.email)}/`}>{this.props.name}</Link>;
|
|
}
|
|
}
|
|
|
|
UserLink.propTypes = propTypes;
|
|
|
|
export default UserLink;
|