// Copyright (c) 2015 Mattermost, Inc. All Rights Reserved. // See License.txt for license information. import MemberListTeam from './member_list_team.jsx'; import TeamStore from '../stores/team_store.jsx'; const Modal = ReactBootstrap.Modal; export default class TeamMembersModal extends React.Component { constructor(props) { super(props); this.onShow = this.onShow.bind(this); } componentDidMount() { if (this.props.show) { this.onShow(); } } componentDidUpdate(prevProps) { if (this.props.show && !prevProps.show) { this.onShow(); } } onShow() { if ($(window).width() > 768) { $(ReactDOM.findDOMNode(this.refs.modalBody)).perfectScrollbar(); $(ReactDOM.findDOMNode(this.refs.modalBody)).css('max-height', $(window).height() - 200); } else { $(ReactDOM.findDOMNode(this.refs.modalBody)).css('max-height', $(window).height() - 150); } } render() { const team = TeamStore.getCurrent(); return ( {team.display_name + ' Members'}
); } } TeamMembersModal.propTypes = { show: React.PropTypes.bool.isRequired, onHide: React.PropTypes.func.isRequired };