<commit_before>var React = require('react');
var Reflux = require('reflux');
var _ = require('lodash');
var Infinite = require('react-infinite');

var UserListItem = require('./UserListItem.jsx');
var channelStore = require('../stores/channel');
var selectedTabStore = require('../stores/selectedTab');

var UserList = React.createClass({
	mixins: [
		Reflux.connect(channelStore, 'channels'),
		Reflux.connect(selectedTabStore, 'selectedTab')
	],

	getInitialState: function() {
		return {
			channels: channelStore.getState(),
			selectedTab: selectedTabStore.getState(),
			height: window.innerHeight - 100
		};
	},

	componentDidMount: function() {
		window.addEventListener('resize', this.handleResize);
	},

	componentWillUnmount: function() {
		window.removeEventListener('resize', this.handleResize);
	},

	handleResize: function() {
		this.setState({ height: window.innerHeight - 100 });
	},

	render: function() {
		var users = [];
		var tab = this.state.selectedTab;
		var style = {};

		if (!tab.channel || tab.channel[0] !== '#') {
			style.display = 'none';
		} else {
			users = _.map(channelStore.getUsers(tab.server, tab.channel), (user) => {
				return <UserListItem key={user.nick} user={user} />;
			});
		}

		return (
			<div className="userlist" style={style}>
				<Infinite containerHeight={this.state.height} elementHeight={24}>
					{users}
				</Infinite>
			</div>
		);
	}
});

module.exports = UserList;<commit_msg>Render userlist to a div if theres only one user<commit_after>var React = require('react');
var Reflux = require('reflux');
var _ = require('lodash');
var Infinite = require('react-infinite');

var UserListItem = require('./UserListItem.jsx');
var channelStore = require('../stores/channel');
var selectedTabStore = require('../stores/selectedTab');

var UserList = React.createClass({
	mixins: [
		Reflux.connect(channelStore, 'channels'),
		Reflux.connect(selectedTabStore, 'selectedTab')
	],

	getInitialState: function() {
		return {
			channels: channelStore.getState(),
			selectedTab: selectedTabStore.getState(),
			height: window.innerHeight - 100
		};
	},

	componentDidMount: function() {
		window.addEventListener('resize', this.handleResize);
	},

	componentWillUnmount: function() {
		window.removeEventListener('resize', this.handleResize);
	},

	handleResize: function() {
		this.setState({ height: window.innerHeight - 100 });
	},

	render: function() {
		var users = [];
		var tab = this.state.selectedTab;
		var style = {};

		if (!tab.channel || tab.channel[0] !== '#') {
			style.display = 'none';
		} else {
			users = _.map(channelStore.getUsers(tab.server, tab.channel), (user) => {
				return <UserListItem key={user.nick} user={user} />;
			});
		}

		if (users.length !== 1) {
			return (
				<div className="userlist" style={style}>
					<Infinite containerHeight={this.state.height} elementHeight={24}>
						{users}
					</Infinite>
				</div>
			);
		} else {
			return (
				<div className="userlist" style={style}>
					<div>{users}</div>
				</div>
			);
		}		
	}
});

module.exports = UserList;
{'fraction_non_alphanumeric': 0.17149365440937195, 'fraction_numerical': 0.006182883176049463, 'mean_word_length': 4.106312292358804, 'pattern_counts': {'":': 0, '<': 17, '<?xml version=': 0, '>': 19, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4025188', 'n_tokens_mistral': 1118, 'n_tokens_neox': 972, 'n_words': 192}