mirror of
https://github.com/haiwen/seahub.git
synced 2025-09-25 23:02:26 +00:00
21 lines
491 B
JavaScript
21 lines
491 B
JavaScript
![]() |
import React, { Component } from 'react';
|
||
|
import PropTypes from 'prop-types';
|
||
|
import { Link } from '@reach/router';
|
||
|
import { siteRoot } from '../../utils/constants';
|
||
|
|
||
|
const propTypes = {
|
||
|
email: PropTypes.string.isRequired,
|
||
|
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;
|