1
0
mirror of https://github.com/BoostIo/Boostnote synced 2025-12-15 02:36:36 +00:00

Going LIte

This commit is contained in:
Rokt33r
2015-10-30 14:53:09 +09:00
parent ba0daf4452
commit d9442aa23c
40 changed files with 978 additions and 853 deletions

View File

@@ -24,21 +24,7 @@ class Preferences extends React.Component {
super(props)
this.state = {
currentTab: PROFILE,
currentTeamId: props.status.userId,
profile: {
userInfo: {
profileName: props.currentUser.profileName,
email: props.currentUser.email,
alert: null
},
password: {
currentPassword: '',
newPassword: '',
confirmation: '',
error: null
}
}
currentTab: APP
}
}
@@ -56,12 +42,8 @@ class Preferences extends React.Component {
let content = this.renderContent()
let tabs = [
{target: PROFILE, label: 'Profile'},
{target: APP, label: 'Preferences'},
{target: HELP, label: 'Help & Feedback'},
{target: TEAM, label: 'Team setting'},
{target: MEMBER, label: 'Manage member'},
{target: FOLDER, label: 'Manage folder'}
{target: APP, label: 'Preferences'}
// {target: FOLDER, label: 'Manage folder'}
]
let navButtons = tabs.map(tab => (
@@ -85,42 +67,12 @@ class Preferences extends React.Component {
}
renderContent () {
let currentTeamId = parseInt(this.state.currentTeamId, 10)
let teams = [this.props.currentUser].concat(this.props.currentUser.Teams)
switch (this.state.currentTab) {
case APP:
return (<AppSettingTab/>)
case HELP:
return (<HelpTab/>)
case TEAM:
return (
<TeamSettingTab
currentTeamId={currentTeamId}
teams={teams}
switchTeam={teamId => this.switchTeam(teamId)}
/>
)
case MEMBER:
return (
<MemberSettingTab
currentUser={this.props.currentUser}
currentTeamId={currentTeamId}
teams={teams}
switchTeam={teamId => this.switchTeam(teamId)}
/>
)
case FOLDER:
return (
<FolderSettingTab
currentTeamId={currentTeamId}
teams={teams}
switchTeam={teamId => this.switchTeam(teamId)}
/>
)
case PROFILE:
case APP:
default:
return this.renderProfile()
return (<AppSettingTab/>)
}
}