import React from 'react'; import { connect } from 'react-redux'; import { Label } from 'app/core/components/Label/Label'; import { SharedPreferences } from 'app/core/components/SharedPreferences/SharedPreferences'; import { updateTeam } from './state/actions'; import { getRouteParamsId } from 'app/core/selectors/location'; import { getTeam } from './state/selectors'; import { Team } from 'app/types'; export interface Props { team: Team; updateTeam: typeof updateTeam; } interface State { name: string; email: string; } export class TeamSettings extends React.Component { constructor(props) { super(props); this.state = { name: props.team.name, email: props.team.email, }; } onChangeName = event => { this.setState({ name: event.target.value }); }; onChangeEmail = event => { this.setState({ email: event.target.value }); }; onUpdate = event => { const { name, email } = this.state; event.preventDefault(); this.props.updateTeam(name, email); }; render() { const { team } = this.props; const { name, email } = this.state; return (

Team Settings

); } } function mapStateToProps(state) { const teamId = getRouteParamsId(state.location); return { team: getTeam(state.team, teamId), }; } const mapDispatchToProps = { updateTeam, }; export default connect(mapStateToProps, mapDispatchToProps)(TeamSettings);