Merge branch 'master' into edit-comment-settings

This commit is contained in:
Benjamin Goering
2017-05-17 15:46:14 -07:00
committed by GitHub
2 changed files with 13 additions and 3 deletions
@@ -30,3 +30,13 @@
font-weight: bold;
}
}
.profileEmail {
border: none;
background-color: transparent;
pointer-events: none;
font-size: 16px;
position: absolute;
width: 100%;
outline: none;
}
@@ -11,7 +11,7 @@ class UserDetail extends React.Component {
hideUserDetail: PropTypes.func.isRequired
}
copyPermalink () {
copyPermalink = () => {
this.profile.select();
try {
document.execCommand('copy');
@@ -45,8 +45,8 @@ class UserDetail extends React.Component {
return (
<Drawer handleClickOutside={hideUserDetail}>
<h3>{user.username}</h3>
<Button className={styles.copyButton}>Copy</Button>
{profile && <p ref={(ref) => this.profile = ref} contentEditable="true">{profile}</p>}
<Button className={styles.copyButton} onClick={this.copyPermalink}>Copy</Button>
{profile && <input className={styles.profileEmail} type="text" ref={(ref) => this.profile = ref} value={profile} />}
<Slot fill="userProfile" user={user} />
<p className={styles.memberSince}><strong>Member since</strong> {new Date(user.created_at).toLocaleString()}</p>
<hr/>