diff --git a/browser/main/HomePage/ArticleNavigator.js b/browser/main/HomePage/ArticleNavigator.js index 8b4ec9fc..b277916c 100644 --- a/browser/main/HomePage/ArticleNavigator.js +++ b/browser/main/HomePage/ArticleNavigator.js @@ -8,10 +8,6 @@ import Preferences from 'boost/components/modal/Preferences' import CreateNewFolder from 'boost/components/modal/CreateNewFolder' export default class ArticleNavigator extends React.Component { - componentDidMount () { - this.handlePreferencesButtonClick() - } - handlePreferencesButtonClick (e) { openModal(Preferences) } diff --git a/browser/styles/main/HomeContainer/components/ArticleNavigator.styl b/browser/styles/main/HomeContainer/components/ArticleNavigator.styl index 84158d77..4accb134 100644 --- a/browser/styles/main/HomeContainer/components/ArticleNavigator.styl +++ b/browser/styles/main/HomeContainer/components/ArticleNavigator.styl @@ -90,6 +90,7 @@ articleNavBgColor = #353535 background-color transparent color white padding-left 15px + overflow ellipsis &:hover background-color transparentify(white, 5%) &.active, &:active diff --git a/browser/styles/main/HomeContainer/lib/Preferences.styl b/browser/styles/main/HomeContainer/lib/Preferences.styl index 20b746c4..56573b8a 100644 --- a/browser/styles/main/HomeContainer/lib/Preferences.styl +++ b/browser/styles/main/HomeContainer/lib/Preferences.styl @@ -250,6 +250,36 @@ iptFocusBorderColor = #369DCD &>.control float right &>li + &.edit + .colDescription + font-size 14px + line-height 33px + padding-left 15px + float left + strong + font-size 16px + color brandColor + .colDeleteConfirm + float right + margin-right 15px + button + border none + height 30px + width 60px + margin-top 1.5px + font-size 14px + background-color transparent + color stripBtnColor + &:hover + color stripHoverBtnColor + &:disabled + color lighten(stripBtnColor, 10%) + cursor not-allowed + &.primary + color brandColor + &:hover + color lighten(brandColor, 10%) + border-bottom 1px solid borderColor height 44px padding 0 25px @@ -272,11 +302,14 @@ iptFocusBorderColor = #369DCD .userInfo float left margin-top 7px + width 205px .userName font-size 16px margin-bottom 2px + overflow ellipsis .userEmail font-size 12px + overflow ellipsis .colRole float left width 75px @@ -365,6 +398,7 @@ iptFocusBorderColor = #369DCD font-size 14px outline none width 150px + overflow ellipsis &:hover border-color borderColor &:focus diff --git a/lib/components/modal/Preference/MemberRow.js b/lib/components/modal/Preference/MemberRow.js new file mode 100644 index 00000000..d52d8c33 --- /dev/null +++ b/lib/components/modal/Preference/MemberRow.js @@ -0,0 +1,106 @@ +import React, { PropTypes } from 'react' +import ProfileImage from 'boost/components/ProfileImage' +import api from 'boost/api' + +const IDLE = 'IDLE' +const DELETE = 'DELETE' + +export default class MemberRow extends React.Component { + constructor (props) { + super(props) + + this.state = { + mode: IDLE + } + } + handleMemberRoleChange (e) { + let input = { + name: this.props.member.name, + role: e.target.value + } + + api.setMember(this.props.team.id, input) + .then(res => { + console.log(res.body) + }) + .catch(err => { + if (err.status != null) throw err + else console.error(err) + }) + } + + handleDeleteButtonClick (e) { + this.setState({mode: DELETE}) + } + + handleCancelButtonClick (e) { + this.setState({mode: IDLE}) + } + + handleDeleteConfirmButtonClick (e) { + let input = { + name: this.props.member.name + } + + api.deleteMember(this.props.team.id, input) + .then(res => { + console.log(res.body) + }) + .catch(err => { + if (err.status != null) throw err + else console.error(err) + }) + } + + render () { + let member = this.props.member + let currentUser = this.props.currentUser + let isDisabled = (currentUser.id === member.id) + + switch (this.state.mode) { + case DELETE: + return ( +